Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2017-02-06 10:02:42

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Error i cant debug

Hi

The error throw and i cant debug it, there is not enough information on debug mode, i suspect cbe_front_auth becuase when i remove it code the page appears but i dont know how to solve that! weird.

The txp code that throw the error is txp:cbe_front_auth but that happen only when 2 cbe_front_auth is used! but when used the cbe_front_auth alone without the remaining code there is nos error! it s really strange!

I am not sure it s only cbe plugin fault because using them and removing some txp:category_list the code work, is it the new parser in fault here maybe?

has someone any idea ?
txp 4.6.2

Below the debug info:


<pre dir="auto">Erreur de balise : <b></b> -> <b> Notice: Undefined offset: 7 lors du traitement du module “Aucun” dans le gabarit “membre”</b></pre>
<pre class="backtrace" dir="ltr"><code>textpattern/lib/txplib_misc.php:4476 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()</code></pre><pre dir="auto">Erreur de balise : <b>&lt;txp:/&gt;</b> -> <b> Textpattern Warning: cette balise n’existe pas lors du traitement du module “Aucun” dans le gabarit “membre”</b></pre>
<pre class="backtrace" dir="ltr"><code>textpattern/lib/txplib_publish.php:521 trigger_error()
textpattern/lib/txplib_publish.php:463 processTags()
textpattern/lib/txplib_misc.php:4476 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()</code></pre><pre dir="auto">Erreur de balise : <b></b> -> <b> Notice: Undefined offset: 8 lors du traitement du module “Aucun” dans le gabarit “membre”</b></pre>
<pre class="backtrace" dir="ltr"><code>textpattern/lib/txplib_misc.php:4476 parse()
textpattern/publish.php:562 parse_page()
index.php:105 textpattern()</code></pre><!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <title>BniDarek - Espace Membre</title>
        <meta name="viewport" content="width=device-width">

        <!-- Google Fonts -->
        <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300%7CRaleway:400,300%7CRoboto:400,700,300%7CLato' rel='stylesheet' type='text/css' />
        <!-- Icon CSS -->
        <link rel="stylesheet" href="/assets/css/global/iconstyle.css" />
        <link rel="stylesheet" href="/assets/fonts/font-awasome/font-awesome.min.css" />
        <!-- Global plugin CSS -->
        <link rel="stylesheet" href="/assets/css/global/bootstrap.min.css" />
        <link rel="stylesheet" href="/assets/css/global/slidePanel.min.css" />
        <link rel="stylesheet" href="/assets/css/switchery/switchery.min.css" />
        <link rel="stylesheet" href="/assets/css/global/waves.min.css" />
        <link rel="stylesheet" href="/assets/plugin/bootstrap-tour/css/bootstrap-tour.css" />
        <!--  Global Template CSS -->
        <link rel="stylesheet" href="/assets/css/global/style.css" />
        <link id="site-color" rel="stylesheet" href="/assets/css/colors/default.css" />
        <link rel="stylesheet" href="/assets/css/global/responsive.css" />
        <link rel="stylesheet" href="/assets/css/global/site.min.css" />

				<!-- Page plugin CSS -->
        <link rel="stylesheet" href="/assets/plugin/magnific-popup/css/magnific-popup.min.css">

				<link rel="stylesheet" href="/assets/css/datatable/dataTables.bootstrap.min.css">
        <link rel="stylesheet" href="/assets/css/datatable/responsive.bootstrap.min.css">
        <link rel="stylesheet" href="/assets/css/datatable/scroll-datatable.css">
        <link rel="stylesheet" href="/assets/css/editable-table/editable-table.min.css">

        <!--  Page CSS -->
        <link rel="stylesheet" href="/assets/css/media/media.css">
        <!-- Page CSS -->

        <link href="/assets/css/footable/footable.min.css" rel="stylesheet" type="text/css"/>
        <link href="/assets/css/invoice/invoice-print.css" rel="stylesheet" type="text/css"/>



				<link rel="stylesheet" media="screen" href="http://bnidarek.com/css.php?n=membre" />

    </head>



<!-- Trace summary:
Runtime   : 126,26 ms
Query time: 7,26 ms
Queries   : 11
Memory (*): 7115 kB
-->

<!-- Trace log:
  Time(ms) | Duration | Trace
      1,96 |    16,87 | [PHP includes, stage 1]
     22,50 |    22,00 | [PHP includes, stage 2]
     23,01 |          | 	[Textpattern autoload dir: 'vendors']
     23,05 |          | 	[Textpattern autoload dir: 'lib']
     41,65 |     0,32 | 	[Load: 'vendors/Txp.php']
     41,83 |     0,11 | 		[Load: 'vendors/Textpattern/Container/FactoryInterface.php']
     41,96 |          | 		[Class loaded: 'Txp']
     42,01 |     0,35 | 	[Load: 'vendors/Textpattern/Container/Container.php']
     42,23 |     0,10 | 		[Load: 'vendors/Textpattern/Container/ContainerInterface.php']
     42,35 |          | 		[Class loaded: 'Container']
     42,40 |     0,33 | 	[Load: 'vendors/Textpattern/Tag/Registry.php']
     42,63 |     0,08 | 		[Load: 'vendors/Textpattern/Container/ReusableInterface.php']
     42,73 |          | 		[Class loaded: 'Registry']
     44,61 |     0,92 | [SQL: SELECT name, val FROM txp_prefs WHERE prefs_id = 1 AND user_name = '' ]
     45,56 |          | [Rows: 145]
     46,22 |     0,41 | [SQL: SELECT name, data FROM txp_lang WHERE lang = 'fr-fr' AND name != '' AND event IN ('public','common') ]
     46,63 |          | [Rows: 416]
     47,40 |    60,78 | [Loading plugins]
     47,43 |     1,05 | 	[SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND type IN (0,1,5) ORDER BY load_order ASC, name ASC ]
     48,50 |          | 	[Rows: 16]
     49,07 |     2,03 | 	[Loading plugin: 'etc_pagination' version '0.4.5']
     51,12 |     2,75 | 	[Loading plugin: 'cbe_frontauth' version '0.9.6']
     53,90 |     0,31 | 	[Loading plugin: 'adi_calc' version '1.1']
     54,23 |     0,21 | 	[Loading plugin: 'adi_gps' version '0.2']
     54,46 |     0,97 | 	[Loading plugin: 'cbe_members' version 'a.1.2']
     55,46 |    12,43 | 	[Loading plugin: 'ied_plugin_composer' version '1.06']
     67,94 |    22,13 | 	[Loading plugin: 'mem_self_register' version '0.9.8']
     72,45 |     0,40 | 		[SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND name = 'mem_form' ]
     72,88 |          | 		[Rows: 1]
     77,65 |     0,54 | 		[SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND name = 'glz_custom_fields' ]
     78,21 |          | 		[Rows: 1]
     83,45 |     0,83 | 		[SQL: 
    SELECT
      `name` AS custom_set,
      `val` AS name,
      `position`,
      `html` AS type
    FROM
      `txp_prefs`
    WHERE
      `event`='custom'
    ORDER BY
      `position`
   ]
     84,30 |          | 		[Rows: 12]
     84,43 |     0,69 | 		[SQL: 
      SELECT
        `name`, `val`
      FROM
        `txp_prefs`
      WHERE
        `html` = 'date-picker'
      AND
        `name` LIKE 'custom_%'
      ORDER BY
        `name`
     ]
     85,13 |          | 		[Rows: 0]
     85,17 |     0,63 | 		[SQL: 
      SELECT
        `name`, `val`
      FROM
        `txp_prefs`
      WHERE
        `html` = 'time-picker'
      AND
        `name` LIKE 'custom_%'
      ORDER BY
        `name`
     ]
     85,81 |          | 		[Rows: 0]
     90,11 |     1,04 | 	[Loading plugin: 'mem_simple_form' version '0.3.2']
     91,19 |     0,13 | 	[Loading plugin: 'pap_contact_cleaner' version '0.1']
     91,34 |     2,37 | 	[Loading plugin: 'smd_if' version '0.91']
     93,75 |     1,61 | 	[Loading plugin: 'smd_query' version '0.50']
     95,38 |     0,14 | 	[Loading plugin: 'upm_insert_tab' version '0.2.2']
     95,56 |     5,08 | 	[Loading plugin: 'zem_contact_reborn' version '4.5.0.0']
    100,67 |     0,20 | 	[Loading plugin: 'dzd_mailtodb' version '0.1']
    100,90 |     7,25 | 	[Loading plugin: 'smd_user_manager' version '0.21']
    108,46 |     0,82 | [Callback_event: 'pretext', step='', pre='0']
    108,57 |     0,46 | 	[Load: 'vendors/Textpattern/Type/TypeCallable.php']
    108,87 |     0,13 | 		[Load: 'vendors/Textpattern/Type/TypeInterface.php']
    109,02 |          | 		[Class loaded: 'TypeCallable']
    109,10 |     0,08 | 		[Call function: 'etc_pagination_url']
    109,22 |     0,04 | 		[Call function: 'ied_plugin_download']
    109,62 |     0,98 | [SQL: SELECT page, css FROM txp_section WHERE name = 'membre' LIMIT 1 ]
    110,62 |          | [Rows: 1]
    110,70 |     0,02 | [Callback_event: 'pretext_end', step='', pre='0']
    110,80 |     0,02 | [Callback_event: 'log_hit', step='', pre='0']
    110,85 |     0,02 | [Callback_event: 'textpattern', step='', pre='0']
    110,95 |     0,53 | [SQL: SELECT user_html FROM txp_page WHERE name = 'membre' ]
    111,50 |          | [Rows: 1]
    111,54 |          | [Page: 'membre']
    120,35 |     2,29 | <txp:cbe_frontauth_if_logged>
    122,18 |     0,26 | 	[SQL: SELECT nonce, name, RealName, email, privs, last_access FROM txp_users WHERE name = 'rabah.rabah-51' ]
    122,46 |          | 	[Rows: 1]
    122,64 |          | </txp:cbe_frontauth_if_logged>
    122,66 |     0,23 | <txp:css format="link" />
    122,92 |     0,03 | <txp:hide>
    122,95 |          | </txp:hide>
    123,28 |          | Erreur de balise :  -> Notice: Undefined offset: 7 lors du traitement du module “Aucun” dans le gabarit “membre”
*   123,30 |     2,56 | <txp:/>
*   125,84 |          | 	Erreur de balise : <txp:/> -> Textpattern Warning: cette balise n’existe pas lors du traitement du module “Aucun” dans le gabarit “membre”
    126,03 |          | Erreur de balise :  -> Notice: Undefined offset: 8 lors du traitement du module “Aucun” dans le gabarit “membre”
    126,15 |          | [ ~~~ secondpass ~~~ ]
    126,22 |     0,03 | [Callback_event: 'textpattern_end', step='', pre='0']
-->

<!-- Query log:
Duration | Query
    0,92 | [SQL: SELECT name, val FROM txp_prefs WHERE prefs_id = 1 AND user_name = '' ]
    0,41 | [SQL: SELECT name, data FROM txp_lang WHERE lang = 'fr-fr' AND name != '' AND event IN ('public','common') ]
    1,05 | [SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND type IN (0,1,5) ORDER BY load_order ASC, name ASC ]
    0,40 | [SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND name = 'mem_form' ]
    0,54 | [SQL: SELECT name, code, version FROM txp_plugin WHERE status = 1 AND name = 'glz_custom_fields' ]
    0,83 | [SQL: 
    SELECT
      `name` AS custom_set,
      `val` AS name,
      `position`,
      `html` AS type
    FROM
      `txp_prefs`
    WHERE
      `event`='custom'
    ORDER BY
      `position`
   ]
    0,69 | [SQL: 
      SELECT
        `name`, `val`
      FROM
        `txp_prefs`
      WHERE
        `html` = 'date-picker'
      AND
        `name` LIKE 'custom_%'
      ORDER BY
        `name`
     ]
    0,63 | [SQL: 
      SELECT
        `name`, `val`
      FROM
        `txp_prefs`
      WHERE
        `html` = 'time-picker'
      AND
        `name` LIKE 'custom_%'
      ORDER BY
        `name`
     ]
    0,98 | [SQL: SELECT page, css FROM txp_section WHERE name = 'membre' LIMIT 1 ]
    0,53 | [SQL: SELECT user_html FROM txp_page WHERE name = 'membre' ]
    0,26 | [SQL: SELECT nonce, name, RealName, email, privs, last_access FROM txp_users WHERE name = 'rabah.rabah-51' ]
-->

Offline

#2 2017-02-06 10:11:37

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

A precsision is when i remove the inner txp:category_list of this code the page works as expected (this code works when not using cbe_front_auth):

<txp:category_list wraptag="ul" break="li" children="0" class="site-menu-sub" parent="produits" exclude="produits" break="">
	<txp:variable name="thecat"><txp:category /></txp:variable>
	<txp:variable name="has-children" value='<txp:category_list parent=''<txp:category />'' exclude=''<txp:category />''>yes</txp:category_list>' />
	<txp:if_variable name="has-children" value="">
		<li><txp:category title="1" section="membre" link="1" class="waves-effect waves-light" /></li>
	<txp:else />
	<li class="has-sub">
         <a href="javascript:void(0)" class="waves-effect waves-light"><txp:category title="1"/><span class="arrow_carrot-right" aria-hidden="true"></span></a>
	<txp:if_category name="electricite">
	<txp:category_list wraptag="ul" break="li" children="0" class="site-menu-sub" parent="electricite" exclude="electricite" break="">
	<li><txp:category title="1" section="membre" link="1" class="waves-effect waves-light" /></li>																
	</txp:category_list>
	</txp:if_category>
        </li>
	</txp:if_variable>
</txp:category_list>

Offline

#3 2017-02-06 11:13:22

etc
Developer
Registered: 2010-11-11
Posts: 5,396
Website GitHub

Re: Error i cant debug

Hi Rabah,

this typically happens with the new parser when you have unclosed tags, even inside <txp:hide />. Debugging in 4.6 is difficult, 4.7 is more verbose about it.

Offline

#4 2017-02-06 11:29:58

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hi
I dont think there is an unclosed tag somewhere, but i can post the block code if someone want to check.

Then the solution is to use txp 4.5.7 ?

here it is below :

<!DOCTYPE html>
<html lang="fr">
    <head>
        <meta charset="utf-8">
        <meta name="description" content="">
        <title>BniDarek - Espace Membre</title>
        <meta name="viewport" content="width=device-width">

        <!-- Google Fonts -->
        <link href='https://fonts.googleapis.com/css?family=Source+Sans+Pro:400,300%7CRaleway:400,300%7CRoboto:400,700,300%7CLato' rel='stylesheet' type='text/css' />
        <!-- Icon CSS -->
        <link rel="stylesheet" href="/assets/css/global/iconstyle.css" />
        <link rel="stylesheet" href="/assets/fonts/font-awasome/font-awesome.min.css" />
        <!-- Global plugin CSS -->
        <link rel="stylesheet" href="/assets/css/global/bootstrap.min.css" />
        <link rel="stylesheet" href="/assets/css/global/slidePanel.min.css" />
        <link rel="stylesheet" href="/assets/css/switchery/switchery.min.css" />
        <link rel="stylesheet" href="/assets/css/global/waves.min.css" />
        <link rel="stylesheet" href="/assets/plugin/bootstrap-tour/css/bootstrap-tour.css" />
        <!--  Global Template CSS -->
        <link rel="stylesheet" href="/assets/css/global/style.css" />
        <link id="site-color" rel="stylesheet" href="/assets/css/colors/default.css" />
        <link rel="stylesheet" href="/assets/css/global/responsive.css" />
        <link rel="stylesheet" href="/assets/css/global/site.min.css" />

				<!-- Page plugin CSS -->
        <link rel="stylesheet" href="/assets/plugin/magnific-popup/css/magnific-popup.min.css">

				<link rel="stylesheet" href="/assets/css/datatable/dataTables.bootstrap.min.css">
        <link rel="stylesheet" href="/assets/css/datatable/responsive.bootstrap.min.css">
        <link rel="stylesheet" href="/assets/css/datatable/scroll-datatable.css">
        <link rel="stylesheet" href="/assets/css/editable-table/editable-table.min.css">

        <!--  Page CSS -->
        <link rel="stylesheet" href="/assets/css/media/media.css">
        <!-- Page CSS -->

        <link href="/assets/css/footable/footable.min.css" rel="stylesheet" type="text/css"/>
        <link href="/assets/css/invoice/invoice-print.css" rel="stylesheet" type="text/css"/>

				<txp:cbe_frontauth_protect><txp:else/>
        <link href="/assets/css/login-page/form.css" rel="stylesheet" type="text/css" />
        <link rel="stylesheet" href="/assets/css/validation/validation.css" type="text/css" />
				</txp:cbe_frontauth_protect>

				<txp:css format="link" />

    </head>

	<txp:hide><!-- ///////////////////////////
											PARTIE FOURNISSEUR
								//////////////////////////// -->
	</txp:hide>
	<txp:cbe_frontauth_protect level="6">
		<body class="dashboard site-menu-left">
        <!-- Start Header Section -->
        <div class="main-header navbar navbar-default navbar-fixed-top navbar-inverse navbar-mega">
            <div class="navbar-header">
                <!--  Template Logo -->
                <a class="navbar-brand" href="/index.php?s=membre">
                    <img class="navbar-brand-logo navbar-brand-logo-normal" src="/assets/images/bnidarek1.png" title="BniDarek" alt="BniDarek">
                </a>
                <div>
                    <button class="button-menu-mobile open-left waves-effect">
                        <i class="icon_menu"></i>
                    </button>
                </div>
            </div>
            <div class="navbar-container container-fluid">
                <div class="collapse navbar-collapse navbar-block navbar-collapse-toolbar" id="site-navbar-collapse">

                    <ul class="nav navbar-nav navbar-toolbar navbar-right">
                        <li id="search-icon">
                            <!--  Toggle Search  -->
                            <a class="icon icon_search waves-effect waves-light" href="javascript:void(0)" role="button">
                                <span class="sr-only">Toggle Search</span>
                            </a>
                        </li>
                        <li class="dropdown">
                            <!--  Profile Section -->
                            <a class="navbar-avatar dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="javascript:void(0)" data-animation="scale-up" role="button">
                                <span class="avatar avatar-online">
                                    <img src="/assets/images/global/img_240x265.png" alt="Profile Image">
                                    <i></i>
                                </span>
                            </a>
                            <ul class="dropdown-menu dropdown-top-border position-absolute" role="menu">
                                <li role="presentation">
                                    <a href="javascript:void(0)" role="menuitem"><i class="icon icon_profile" aria-hidden="true"></i> Profile</a>
                                </li>
                                <li class="divider" role="presentation"></li>
                                <li role="presentation">
                                    <a href="/index.php?s=membre&logout=1" role="menuitem"><i class="icon icon_lock_alt" aria-hidden="true"></i> Logout</a>
                                </li>
                            </ul>
                        </li>
                        <li id="toggleFullscreen">
                            <!--  Full Screen -->
                            <a class="icon icon-fullscreen waves-effect waves-light" id="toggle" data-toggle="fullscreen" href="javascript:void(0)" role="button">
                                <span aria-hidden="true" class="arrow_expand"></span>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="navbar-search-overlap" id="site-navbar-search">
                    <form role="search" action="/index.php?s=membre">
                        <div class="form-group">
                            <!--  Search Box -->
                            <div class="input-search">
                                <i class="input-search-icon icon_search" aria-hidden="true"></i>
                                <input type="text" class="form-control" name="q" placeholder="Search...">
																<input type="hidden" name="s" value="membre">
                                <button type="button" class="input-search-close icon icon_close" aria-label="Close"></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>
        <div class="left-side-menu">
            <!--  Menu -->

            <div class="clearfix"></div>

        </div>
        <!-- End Header Section -->

		<txp:if_article_list>
			<txp:if_category>

				<div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content">
							<div class="row">
						<txp:article limit="12">

                    <div class="col-lg-3 col-sm-6 col-xs-12">
                        <div class="data data-shadow-media simpleCart_shelfItem">
                            <div class="main-media-img">
                                <figure class="data-header overlap">
                                    <div class="overlap-figure overlap-scale">
                                        <div class="overlap-media">
                                            <!-- Image Media -->
																				<txp:if_article_image>
																						<txp:images break=""><a class="media_zoom_image" href="<txp:image_url/>"><txp:thumbnail class="overlap-figure overlap-scale" style="padding:20px;"/></a></txp:images>
																				<txp:else />
                                            <a class="media_zoom_image" href="../assets/images/media/img_720x480.jpg"><img  class="overlap-figure overlap-scale"  src ="../assets/images/media/img_720x480.jpg" alt="media image"></a>
																				</txp:if_article_image>
                                        </div>
                                    </div>
                                </figure>
                            </div>
                            <!-- Description Media -->
                            <div class="media-desc">
                                <div class="media-menu">
                                    <div class="dropup">
																			<txp:permlink  class=" waves-effect waves-classic"><i class="icon fa-plus"></i></txp:permlink></li>
																			<txp:if_custom_field name="fiche">
																			<a href="<txp:file_download_link id='<txp:custom_field name="fiche"/>'/>"  class=" waves-effect waves-classic"><i class="icon fa-file-pdf-o"></i></a>
																			</txp:if_custom_field>
                                    </div>
                                </div>
																<h5 class="text-info item_desc"><txp:title /></h5>
                                <p>Fournisseur: <span class="item_fournisseur"><txp:custom_field name="fournisseur"/></span><span style="display:none;" class="item_name"><txp:article_id /></span></p>
                                <p><input value="1" class="item_Quantity" type="number" min="0" style="width:80px;" > <span class="item_price"><txp:custom_field name="prix"/> DA</span> <a class="btn btn-success btn-round btn-xs waves-effect waves-light item_add" href='javascript:;'><i class="icon fa-cart-plus" style="font-size:18px;padding:5px 2px;"></i></a></p>
                            </div>
                        </div>
                    </div>

						</txp:article>
							</div>
            </div>
        </div>

			<txp:else /> <!-- if category -->

		    <div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!--  Title Page -->
                    <h1 class="page-title">Bienvenue dans votre espace membre <txp:cbe_frontauth_whois type="RealName"/></h1>
                    <!--  Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active">Espace membre <txp:cbe_frontauth_whois type="RealName"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content container-fluid">
            </div>
        </div>		

			</txp:if_category>
		</txp:if_article_list>

        <!-- Start Footer Section -->
        <footer class="main-footer">
            <div class="footer-copyright">
                © 2017 BniDarek
            </div>
            <div class="footer-right-text">
                All Rights Reserved.
            </div>
        </footer>

        <!--  End Site Right Setting Section -->
        <!-- Global Plugin JavaScript -->
        <script src="/assets/js/global/jquery.min.js"></script>
        <script src="/assets/js/global/bootstrap.min.js"></script>
        <script src="/assets/plugin/bootstrap-tour/js/bootstrap-tour.js"></script>
        <script src="/assets/js/global/waves.min.js"></script>
        <script src="/assets/js/switchery/jQuery.switchery.min.js"></script>
        <script src="/assets/js/full-screen-page/screenfull.min.js"></script>
        <script src="/assets/js/home-page/jquery-slidePanel.min.js"></script>
        <script src="/assets/js/home-page/sidebar.min.js"></script>
        <!-- Global Template JavaScript -->
        <script src="/assets/js/global/site.min.js"></script>
        <script src="/assets/js/sitesettings/site-settings.js"></script>
        <script src="/assets/js/global/site_menu_left.js"></script>
				<!-- Page Plugin JavaScript -->
        <script src="/assets/plugin/magnific-popup/js/jquery.magnific-popup.min.js"></script>
				<script src="/assets/js/media/media.min.js"></script>
				<script src="/assets/js/footable/footable.all.min.js" type="text/javascript"></script>
        <script src="/assets/js/footable/footable.min.js" type="text/javascript"></script>
        <script src="/assets/js/invoice-print/jQuery.print.js" type="text/javascript"></script>

				<!-- Page Plugin JavaScript -->
        <script src="/assets/js/datatable/datatables.min.js"></script>
        <script src="/assets/js/datatable/datatables.bootstrap.js"></script>
        <script src="/assets/js/datatable/dataTables.responsive.min.js"></script>
        <script src="/assets/js/datatable/responsive.bootstrap.min.js"></script>
        <script src="/assets/js/editable-table/mindmup-editabletable.js"></script>
        <script src="/assets/js/editable-table/numeric-input-example.js"></script>

				<script src="/assets/js/editable-table/editable-table.min.js"></script>
        <script src="/assets/js/datatable/custom.js"></script>

    </body>


	<txp:else /> <!-- cbe if level 6 -->



		<txp:hide><!-- ///////////////////////////
												PARTIE ARCHITECTE
									//////////////////////////// -->
		</txp:hide>
	<txp:cbe_frontauth_protect level="5">
    <body class="dashboard site-menu-left">
        <!-- Start Header Section -->
        <div class="main-header navbar navbar-default navbar-fixed-top navbar-inverse navbar-mega">
            <div class="navbar-header">
                <!--  Template Logo -->
                <a class="navbar-brand" href="/index.php?s=membre">
                    <img class="navbar-brand-logo navbar-brand-logo-normal" src="/assets/images/bnidarek1.png" title="BniDarek" alt="BniDarek">
                </a>
                <div>
                    <button class="button-menu-mobile open-left waves-effect">
                        <i class="icon_menu"></i>
                    </button>
                </div>
            </div>
            <div class="navbar-container container-fluid">
                <div class="collapse navbar-collapse navbar-block navbar-collapse-toolbar" id="site-navbar-collapse">

                    <ul class="nav navbar-nav navbar-toolbar navbar-right">
                        <li id="search-icon">
                            <!--  Toggle Search  -->
                            <a class="icon icon_search waves-effect waves-light" href="javascript:void(0)" role="button">
                                <span class="sr-only">Toggle Search</span>
                            </a>
                        </li>
                        <li class="dropdown">
                            <!--  Profile Section -->
                            <a class="navbar-avatar dropdown-toggle waves-effect waves-light" data-toggle="dropdown" href="javascript:void(0)" data-animation="scale-up" role="button">
                                <span class="avatar avatar-online">
                                    <img src="/assets/images/global/img_240x265.png" alt="Profile Image">
                                    <i></i>
                                </span>
                            </a>
                            <ul class="dropdown-menu dropdown-top-border position-absolute" role="menu">
                                <li role="presentation">
                                    <a href="javascript:void(0)" role="menuitem"><i class="icon icon_profile" aria-hidden="true"></i> Profile</a>
                                </li>
                                <li class="divider" role="presentation"></li>
                                <li role="presentation">
                                    <a href="/index.php?s=membre&logout=1" role="menuitem"><i class="icon icon_lock_alt" aria-hidden="true"></i> Logout</a>
                                </li>
                            </ul>
                        </li>
                        <li class="dropdown">
                            <!--  Notification Box -->
														<txp:if_category name="checkout1"><txp:else />
															<txp:php>
																session_start();
																if(isset($_SESSION['indicator'])) 
																{
																	unset($_SESSION['indicator']);
																}
															</txp:php>
														</txp:if_category>
                            <a class="waves-effect waves-light" data-toggle="dropdown" href="javascript:void(0)" title="Notifications" data-animation="scale-up" role="button">
                                <i class="icon fa-shopping-cart" aria-hidden="true" style="font-size:20px;"></i>
                                <span class="badge badge-danger up simpleCart_quantity">0</span>
                            </a>
												    <ul class="dropdown-menu dropdown-menu-right dropdown-menu-media dropdown-top-border position-absolute" role="menu">
                                <li class="dropdown-menu-header" role="presentation">
                                    <h5>VOTRE PANIER</h5>
																		 <span class="label label-round label-danger simpleCart_quantity"></span>
                                </li>
																<li class="dropdown-menu-header" role="presentation" style="padding:2px 20px 25px;">
																		<h5><a class="dropdown-menu-noti-btn" style="float:left;" href="/index.php?s=membre&c=checkout">
                                            <i class="icon fa-shopping-cart" aria-hidden="true"></i> Voir Panier
                                    </a>
																		<a class="dropdown-menu-noti-btn simpleCart_empty" href="javascript:;">
                                            <i class="icon fa-eraser" aria-hidden="true"></i> Vider panier
                                    </a></h5>
																</li>
                                <li class="list-group hover-item" role="presentation">
<!-- 														////////////////
																PANIER
																//////////////// -->
																<style>.navbar-nav .item-custom1{ display:none;}</style>
                                    <div data-role="container">
																				<div class='simpleCart_items' data-role="content"></div>
                                    </div>
                                </li>
                            </ul>
                        </li>
                        <li id="toggleFullscreen">
                            <!--  Full Screen -->
                            <a class="icon icon-fullscreen waves-effect waves-light" id="toggle" data-toggle="fullscreen" href="javascript:void(0)" role="button">
                                <span aria-hidden="true" class="arrow_expand"></span>
                            </a>
                        </li>
                    </ul>
                </div>
                <div class="navbar-search-overlap" id="site-navbar-search">
                    <form role="search" action="/index.php">
                        <div class="form-group">
                            <!--  Search Box -->
                            <div class="input-search">
                                <i class="input-search-icon icon_search" aria-hidden="true"></i>
                                <input type="text" class="form-control" name="q" placeholder="Search...">
																<input type="hidden" name="s" value="membre">
                                <button type="button" class="input-search-close icon icon_close" aria-label="Close"></button>
                            </div>
                        </div>
                    </form>
                </div>
            </div>
        </div>

				<div class="left-side-menu">
            <!--  Menu -->
            <div class="sidebar-menu">
                <ul>
										<li class="site-menu-title">
                        Produits
                        <span class="title-i"></span>
                    </li>
                    <li class="has-sub">
                        <a class="waves-effect waves-light" href="javascript:void(0)"> <i class="layout-icon icon_document_alt" aria-hidden="true"></i> <span>List Produits</span> <span class="arrow_carrot-right" aria-hidden="true"></span></a>

												<txp:category_list wraptag="ul" break="li" children="0" class="site-menu-sub" parent="produits" exclude="produits" break="">
													<txp:variable name="thecat"><txp:category /></txp:variable>
													<txp:variable name="has-children"><txp:category_list parent='<txp:category />' exclude='<txp:category />'>yes</txp:category_list></txp:variable>
													<txp:if_variable name="has-children" value="">
														<li><txp:category title="1" section="membre" link="1" class="waves-effect waves-light" /></li>
													<txp:else />
                            <li class="has-sub">
                                <a href="javascript:void(0)" class="waves-effect waves-light"><txp:category title="1"/><span class="arrow_carrot-right" aria-hidden="true"></span></a>
																<txp:category_list wraptag="ul" break="li" children="0" class="site-menu-sub" parent="electricite" exclude="electricite" break="">
																	<li><a href="" class="waves-effect waves-light"><txp:category /></a></li>
																</txp:category_list>
                            </li>

													</txp:if_variable>
												</txp:category_list>
                    </li>
										<li class="site-menu-title">
                        Gestion
                        <span class="title-i"></span>
                    </li>
										<li><txp:category name="commandes" section="membre" class="waves-effect waves-light"> <i class="layout-icon fa-bank" aria-hidden="true"></i> <span>Mes Commandes</span></txp:category></li>
										<li><txp:category name="projets" section="membre" class="waves-effect waves-light"> <i class="layout-icon fa-cogs" aria-hidden="true"></i> <span>Mes Projets</span></txp:category></li>
										<li class="has-sub">
                        <a class="waves-effect waves-light" href="javascript:void(0)"> <i class="layout-icon fa-file-pdf-o" aria-hidden="true"></i> <span>Documentation</span> <span class="arrow_carrot-right" aria-hidden="true"></span></a>
												<txp:category_list wraptag="ul" break="li" children="0" class="site-menu-sub" parent="documentation" exclude="documentation" break="">
														<li><txp:category title="1" section="membre" link="1" class="waves-effect waves-light" /></li>
												</txp:category_list>
                    </li>
								</ul>
						</div>

            <div class="clearfix"></div>

        </div>

        <!-- End Header Section -->
        <!-- Start Contain Section -->
	<txp:if_article_list>
		<txp:if_category>

		<txp:hide><!-- ///////////////////////////
												Checkout
									//////////////////////////// -->
		</txp:hide>
			<txp:if_category name="checkout">
					<txp:article pgonly="1"/>
				        <!-- Start Contain Section -->
        <div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content invoice container-fluid">

                <div class="panel">
                    <div id="ele3" class="a">
                        <div class="panel-body">
                            <div class="row">
                                <!--  Logo Template -->
                                <div class="col-md-9 col-sm-6 col-xs-3 logo-center">
                                    <img class="logo-size" src="/img/bnidarek.png" alt="logo">
																		<p>Vérifiez bien les articles et les quatités, après enregistrement de la commande vous ne pourrez plus changer les produits et quantités par la suite, vous ne pourrez qu'annuler la commande</p>
                                </div>
                            </div>
													<style>.invoice div.item-custom{ display:none;}</style>
                            <div class="table-responsive table-margin">

															<div class='simpleCart_items'></div>

                            </div>
                            <div class="row">
                                <div class="col-lg-3 col-md-3 col-xs-12 col-sm-6 pull-left">
                                    <!--  Sign Section  -->

                                </div>
                                <div class="col-md-5 col-lg-3 col-sm-5 col-xs-12 pull-right total-section">
                                    <!--  Start Total Section  -->
                                    <div class="panel page-total">

                                        <p class="invoice-total text-info">Total HT:&nbsp;
                                            <span class="simpleCart_grandTotal"></span>
                                        </p>
																				<a href="javascript:;" class="print-link btn w-icon btn-info btn-animate btn-animate-side waves-effect margin-bottom-5 simpleCart_checkout"><span><i class="icon fa-credit-card" aria-hidden="true"></i>Enregistrez Commande</span></a>
                                        <button type="submit" onclick="jQuery.print('#ele3')" class="print-link btn w-icon btn-info btn-animate btn-animate-side waves-effect margin-bottom-5">
                                            <span><i class="icon icon_printer" aria-hidden="true"></i>Print</span>
                                        </button>
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
        <!-- End Contain Section -->


			<txp:else /> <!-- if checkout -->

		<txp:hide><!-- ///////////////////////////
												Checkout1
									//////////////////////////// -->
		</txp:hide>
				<txp:if_category name="checkout1">
						<txp:article pgonly="1"/>

				<div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content container-fluid">

								<txp:php>
									session_start();
									if(isset($_SESSION['indicator'])) 
									{
										echo "<h1>Ecriture déjà enregistré</h1>";
									} else {

										$tab1 = array();
										$id_list = array();
										$count = 0;

										if (isset($_POST['itemCount'])){
											$count = $_POST['itemCount'];
										}

										$max_idgrp = safe_row('MAX(CONVERT(id_com, SIGNED INTEGER)) AS id_grp','commande_det','1=1');
										if ($max_idgrp['id_grp'])
										{
												$max_idgrp1 = $max_idgrp['id_grp'];
												// echo "<h2>Max id grp = ".$max_idgrp1."</h2>";
										} else {
												// echo "<h2>Max id grp = 0</h2>";
												$max_idgrp1 = 0;
										}
										$max_idgrp1 += 1;

										$sett = 'NOW()';

										$archi = parse('<txp:cbe_frontauth_whois/>');
										// echo "<h2>Archi = ".$archi."</h2>";

										if ($count){

											for ($i = 1; $i <= $count; $i++) {
												$arr1[] = $i;

												$idprod = $_POST['item_name_'.$i];
												$qtprod = $_POST['item_quantity_'.$i];
												// echo "<h1>".$idprod."</h1>";
												$res = safe_row('Title, custom_7, custom_10','textpattern','ID='.$idprod);

												if ($res['Title']){
													$nameprod = $res['Title'];
													$prixprod = $res['custom_7'];
													$fourn = $res['custom_10'];

													// echo "<h1>".$nameprod." | ".$prixprod."</h1>";

													$myid = safe_insert(
															 "commande_det",
															 "id_com				= '$max_idgrp1',
																id_prod				= '$idprod',
																nom_prod			= '$nameprod',
																fournisseur		= '$fourn',
																prix					= '$prixprod',
																qte						= '$qtprod',
																date					= $sett,
																archi					= '$archi',
																etat					= 'attente'"
															);
													if ($myid<>''){
															// echo "<h1>Ecriture commane reussis".$myid." | ".$idprod."</h1>";
															$_SESSION['indicator'] = "processed";
													 }


												} else {
													echo "Erreur requète BDD :";
													print_r($res);
												}

											}

											variable(array('name' => 'cycle', 'value' => implode(',', $arr1)));
											variable(array('name' => 'id_com', 'value' => $max_idgrp1));

											// echo "<h1>".variable(array('name' => 'id_com'))."</h1>";

										}

									}
								</txp:php>
								<div class="panel">
                    <div id="ele3" class="a">
                        <div class="panel-body">
                            <div class="row">
															<div class="col-lg-12">
																<h2>Commande de <txp:cbe_frontauth_whois type="RealName"/></h2>
																<p>Commande N° <txp:variable name="id_com"/></p>
																<table class="table table-bordered">
																	<thead>
																		<tr>
																			<th>ID</th>
																			<th>ID Prod.</th>
																			<th>Nom Prod.</th>
																			<th>FOURNISSEUR</th>
																			<th>PRIX U</th>
																			<th>QTE</th>
																			<th>DATE</th>
																			<th>ETAT</th>
																		</tr>
																	</thead>
																	<tbody>
																	<txp:smd_query query="SELECT * from commande_det WHERE id_com='?id_com' ORDER BY fournisseur asc, id asc">
																		<tr>
																			<td>{id}</td>
																			<td>{id_prod}</td>
																			<td>{nom_prod}</td>
																			<td>{fournisseur}</td>
																			<td>{prix} DA</td>
																			<td>{qte}</td>
																			<td>{date}</td>
																			<td><span class="label label-warning">{etat}</span></td>
																		</tr>
																	</txp:smd_query>
																	</tbody>
																</table>
															</div>
														</div>
												</div>
												<div class="panel page-total">

													<p class="invoice-total text-info"><span>Total HT:&nbsp;</span>
															<span class="simpleCart_grandTotal"></span>
													</p>
													<button type="submit" onclick="jQuery.print('#ele3')" class="print-link btn w-icon btn-info btn-animate btn-animate-side waves-effect margin-bottom-5">
															<span><i class="icon icon_printer" aria-hidden="true"></i>Imprimer</span>
													</button>
											</div>
										</div>
								</div>

            </div>
        </div>
				<!-- End Contain Section -->


				<txp:else /> <!-- if checkout1 -->

		<txp:hide><!-- ///////////////////////////
												Commandes
									//////////////////////////// -->
		</txp:hide>
					<txp:if_category name="commandes">
						<txp:article pgonly="1"/>

				<div class="main-content datatable">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content validation">
						<!-- Activer commande etat valide -->
						<txp:smd_if field="postvar:activer" operator="isused">
							<txp:adi_gps name="idc" quiet="1"/>
							<txp:adi_gps name="fourn" quiet="1"/>
							<txp:variable name="moiarchi"><txp:cbe_frontauth_whois /></txp:variable>
							<txp:if_variable name="idc" value="">
								<div class="panel panel-warning panel-bordered">
									<div class="panel-body panel-success-box">
										Erreur donnée id nom transmise
									</div>
								</div>
							<txp:else />
								<txp:if_variable name="fourn" value="">
									<txp:smd_query query="UPDATE commande_det SET etat='valide' WHERE archi='?moiarchi' AND id_com='?idc'"/>
								<txp:else />
									<txp:smd_query query="UPDATE commande_det SET etat='valide' WHERE archi='?moiarchi' AND id_com='?idc' AND fournisseur='?fourn'"/>
								</txp:if_variable>
								<div class="panel panel-primary panel-bordered">
									<div class="panel-body panel-primary-box">
										Donnée mise à jour
									</div>
								</div>
							</txp:if_variable>

						</txp:smd_if>

						<!-- Annuler commande etat annule -->
						<txp:smd_if field="postvar:annuler" operator="isused">
							<txp:adi_gps name="idc" quiet="1"/>
							<txp:adi_gps name="fourn" quiet="1"/>
							<txp:variable name="moiarchi"><txp:cbe_frontauth_whois /></txp:variable>
							<txp:if_variable name="idc" value="">
								<div class="panel panel-warning panel-bordered">
									<div class="panel-body panel-success-box">
										Erreur donnée id nom transmise
									</div>
								</div>
							<txp:else />
								<txp:if_variable name="fourn" value="">
									<txp:smd_query query="UPDATE commande_det SET etat='annule' WHERE archi='?moiarchi' AND id_com='?idc'"/>
								<txp:else />
									<txp:smd_query query="UPDATE commande_det SET etat='annule' WHERE archi='?moiarchi' AND id_com='?idc' AND fournisseur='?fourn'"/>
								</txp:if_variable>
								<div class="panel panel-primary panel-bordered">
									<div class="panel-body panel-primary-box">
										Donnée mise à jour
									</div>
								</div>
							</txp:if_variable>

						</txp:smd_if>

						<txp:smd_if field="postvar:afficher,postvar:activer,postvar:annuler" operator="isused,isused,isused" logic="or">

							<txp:adi_gps name="idc" quiet="1"/>
                <div class="panel">
                    <!-- Start Basic Datatable -->
                    <div class="panel-heading">

												<div class="header-bg">
														<div class="page-header">
																<div class="header-left-panel">
																		<div class="header-left-title text-left">
																				<h1 class="page-title">Détail commandes N° <txp:variable name="idc"/></h1>
																		</div>
																		<div class="header-right-panel right-search-header">
																			<form method="POST" style="display:inline-block;">
																				<input type="hidden" name="idc" value="<txp:variable name="idc"/>"/>
																				<input type="submit" name="activer" value="ACTIVER Commande" class="btn btn-info waves-effect waves-light"/>
																			</form>
																			<form method="POST" style="display:inline-block;">
																				<input type="hidden" name="idc" value="<txp:variable name="idc"/>"/>
																				<input type="submit" name="annuler" value="ANNULER Commande" class="btn btn-default waves-effect waves-light"/>
																			</form>
																		</div>
																</div>
														</div>
												</div>

                    </div>
                    <div class="panel-body container-fluid">
										<txp:variable name="moiarchi"><txp:cbe_frontauth_whois /></txp:variable>
										<txp:smd_query query="SELECT fournisseur,date,project_id from commande_det WHERE archi='?moiarchi' AND id_com='?idc' GROUP BY fournisseur ORDER BY fournisseur asc">
                        <div>
													<div class="header-left-panel">
															<div class="header-left-title text-left">
																<h3 class="page-title">Fournisseur <txp:authors name='{fournisseur}' break=""><txp:author /></txp:authors></h3>
																<p>Date de la commande : {date}</p>
																<txp:variable name="projid">{project_id}</txp:variable>
																<txp:if_variable name="projid" value="">
																	<p>Projet : non affecté</p>
																<txp:else />
																	<p>Projet : <txp:variable name="projid"/></p>
																</txp:if_variable>
															</div>
															<div class="header-right-panel right-search-header">
																<form method="POST" style="display:inline-block;">
																	<input type="hidden" name="idc" value="<txp:variable name="idc"/>"/>
																	<input type="hidden" name="fourn" value="{fournisseur}"/>
																	<input type="submit" name="activer" value="ACTIVER Commande {fournisseur}" class="btn btn-info waves-effect waves-light"/>
																</form>
																<form method="POST" style="display:inline-block;">
																	<input type="hidden" name="idc" value="<txp:variable name="idc"/>"/>
																	<input type="hidden" name="fourn" value="{fournisseur}"/>
																	<input type="submit" name="annuler" value="ANNULER Commande {fournisseur}" class="btn btn-default waves-effect waves-light"/>
																</form>
															</div>
													</div>

                            <table class="table table-striped table-bordered dt-responsive nowrap">
                                <thead>
                                    <tr>
                                        <th>ID</th>
																				<th>Nom</th>
                                        <th>Prix</th>
																				<th>Qté</th>
																				<th>Bon Livrais.</th>
																				<th>Date BL</th>
																				<th>A payer</th>
                                        <th>Etat</th>
																				<th>Opération</th>
                                    </tr>
                                </thead>
                                <tbody>
																<txp:variable name="totaf" value="0"/>
																<txp:smd_query query="SELECT * from commande_det WHERE id_com='?idc' AND fournisseur='{fournisseur}' ORDER BY id desc">
																<txp:php>
																	$calcu1 = number_format(floatval({prix})*floatval({qte}), 2, ',', ' ');
																	variable(array("name"=>"totaf", "value"=>"$calcu1"));
																</txp:php>
                                    <tr>
                                        <td>{id}</td>
																				<td>{nom_prod}</td>
                                        <td>{prix}</td>
																				<td>{qte}</td>
																				<td>{bl_num}</td>
																				<td>{bl_date}</td>
																				<td>{apayer}</td>
                                        <td>
																						<txp:variable name="tetat">{etat}</txp:variable>
																						<txp:if_variable name="tetat" value="attente"><span class="label label-warning">Attente</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="valide"><span class="label label-primary">Valide</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="annule"><span class="label label-default">Annulé</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="livraison"><span class="label label-info">Livraison</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="termine"><span class="label label-success">Terminé</span></txp:if_variable>
																				</td>
                                        <td>

																				</td>
                                    </tr>
																</txp:smd_query>
                                </tbody>
                            </table>
														<div class="col-md-6 col-lg-4 col-sm-6 col-xs-12 pull-right total-section">
																<!--  Start Total Section  -->
																<div class="panel page-total">
																		<p class="invoice-total text-info">Sous Total HT:
																				<span><txp:variable name="totaf"/> DA</span>
																		</p>
																</div>
														</div>
														<hr/>
                        </div>
											</txp:smd_query>
                    </div>
                    <!-- End Basic Datatable -->
                </div>						

						<txp:else /> <!-- smd_if -->

                <div class="panel">
                    <!-- Start Basic Datatable -->
                    <div class="panel-heading">
                        <h3 class="panel-title">Liste des commandes</h3>
                    </div>
                    <div class="panel-body container-fluid">
                        <div class="table-rasponsive">
                            <table id="basic-table" class="table table-striped table-bordered dt-responsive nowrap">
                                <thead>
                                    <tr>
                                        <th>Comm. N°</th>
                                        <th>Date</th>
                                        <th>Projet</th>
                                        <th>Etat</th>
																				<th>Afficher</th>
                                    </tr>
                                </thead>
                                <tbody>
																<txp:variable name="moiarchi"><txp:cbe_frontauth_whois /></txp:variable>
																<txp:smd_query query="SELECT * from commande_det WHERE archi='?moiarchi' GROUP BY id_com ORDER BY id_com desc">
                                    <tr>
                                        <td>{id_com}</td>
                                        <td>{date}</td>
                                        <td>{project_id}</td>
                                        <td>
																					<txp:smd_query query="SELECT etat as etat1 from commande_det WHERE archi='?moiarchi' AND id_com='{id_com}' GROUP BY etat">
																						<txp:variable name="tetat">{etat1}</txp:variable>
																						<txp:if_variable name="tetat" value="attente"><span class="label label-warning">Attente</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="valide"><span class="label label-primary">Valide</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="annule"><span class="label label-default">Annulé</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="livraison"><span class="label label-info">Livraison</span></txp:if_variable>
																						<txp:if_variable name="tetat" value="termine"><span class="label label-success">Terminé</span></txp:if_variable>
																					</txp:smd_query>
																				</td>
                                        <td>
																					<form method="POST">
																					<input type="hidden" name="idc" value="{id_com}"/>
																					<input type="submit" name="afficher" value="Voir"/>
																					</form>
																				</td>
                                    </tr>
																</txp:smd_query>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- End Basic Datatable -->
                </div>
						</txp:smd_if>

            </div>
        </div>
				<!-- End Contain Section -->

					<txp:else /> <!-- if commandes -->

		<txp:hide><!-- ///////////////////////////
												MES PROJETS
									//////////////////////////// -->
		</txp:hide>
						<txp:if_category name="projets">
							<txp:article pgonly="1"/>

				<div class="main-content datatable">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content validation">
                <div class="panel">
                    <!-- Start Basic Datatable -->
                    <div class="panel-heading">
                        <h3 class="panel-title">Liste des projets</h3>
                    </div>
                    <div class="panel-body container-fluid">
                        <div class="table-rasponsive">
                            <table id="basic-table" class="table table-striped table-bordered dt-responsive nowrap">
                                <thead>
                                    <tr>
                                        <th>ID</th>
                                        <th>Projet</th>
                                        <th>Date</th>
                                        <th>Commandes</th>
																				<th>Afficher</th>
                                    </tr>
                                </thead>
                                <tbody>
																<txp:variable name="moiarchi"><txp:cbe_frontauth_whois /></txp:variable>
																<txp:article limit="999" architect='<txp:variable name="moiarchi"/>' sort="id desc">
																	<txp:variable name="moiproj"><txp:article_id /></txp:variable>
                                    <tr>
																				<td><txp:article_id /></td>
                                        <td><txp:title /></td>
                                        <td><txp:posted format="%d/%M/%Y" /></td>
                                        <td>
																					<txp:smd_query query="SELECT id_com as idcom1 from commande_det WHERE archi='?moiarchi' AND project_id='?moiproj' GROUP BY id_com">
																						<txp:variable name="tetat">{idcom1}</txp:variable>
																						<a href="http://bnidarek.com/index.php?s=membre&c=commande&id_com={idcom1}" class="label label-warning">Comm. {idcom1}</a>
																					</txp:smd_query>
																				</td>
                                        <td>
																					<form method="POST">
																					<input type="hidden" name="idc" value="<txp:article_id />"/>
																					<input type="submit" name="afficher" value="Voir"/>
																					</form>
																				</td>
                                    </tr>
																</txp:article>
                                </tbody>
                            </table>
                        </div>
                    </div>
                    <!-- End Basic Datatable -->
                </div>

            </div>
        </div>
				<!-- End Contain Section -->

					<txp:else /> <!-- if projets -->


        <div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!-- Title Page -->
                    <h1 class="page-title"><txp:category title="1"/></h1>
                    <!-- Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="active"><txp:category title="1"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content">
							<div class="row">
						<txp:article limit="12">

                    <div class="col-lg-3 col-sm-6 col-xs-12">
                        <div class="data data-shadow-media simpleCart_shelfItem">
                            <div class="main-media-img">
                                <figure class="data-header overlap">
                                    <div class="overlap-figure overlap-scale">
                                        <div class="overlap-media">
                                            <!-- Image Media -->
																				<txp:if_article_image>
																						<txp:images break=""><a class="media_zoom_image" href="<txp:image_url/>"><txp:thumbnail class="overlap-figure overlap-scale" style="padding:20px;"/></a></txp:images>
																				<txp:else />
                                            <a class="media_zoom_image" href="../assets/images/media/img_720x480.jpg"><img  class="overlap-figure overlap-scale"  src ="../assets/images/media/img_720x480.jpg" alt="media image"></a>
																				</txp:if_article_image>
                                        </div>
                                    </div>
                                </figure>
                            </div>
                            <!-- Description Media -->
                            <div class="media-desc">
                                <div class="media-menu">
                                    <div class="dropup">
																			<txp:permlink  class=" waves-effect waves-classic"><i class="icon fa-plus"></i></txp:permlink></li>
																			<txp:if_custom_field name="fiche">
																			<a href="<txp:file_download_link id='<txp:custom_field name="fiche"/>'/>"  class=" waves-effect waves-classic"><i class="icon fa-file-pdf-o"></i></a>
																			</txp:if_custom_field>
                                    </div>
                                </div>
																<h5 class="text-info item_desc"><txp:title /></h5>
                                <p>Fournisseur: <span class="item_fournisseur"><txp:custom_field name="fournisseur"/></span><span style="display:none;" class="item_name"><txp:article_id /></span></p>
                                <p><input value="1" class="item_Quantity" type="number" min="0" style="width:80px;" > <span class="item_price"><txp:custom_field name="prix"/> DA</span> <a class="btn btn-success btn-round btn-xs waves-effect waves-light item_add" href='javascript:;'><i class="icon fa-cart-plus" style="font-size:18px;padding:5px 2px;"></i></a></p>
                            </div>
                        </div>
                    </div>

						</txp:article>
							</div>
            </div>
        </div>

						</txp:if_category> <!-- fin if projets -->

					</txp:if_category> <!-- fin if commandes -->

				</txp:if_category> <!-- fin if checkout1 -->

			</txp:if_category> <!-- fin if checkout -->

		<txp:else /> <!-- if category -->
		    <div class="main-content">
            <div class="page-header">
                <div class="header-left-panel">
                    <!--  Title Page -->
                    <h1 class="page-title">Bienvenue dans votre espace membre <txp:cbe_frontauth_whois type="RealName"/></h1>
                    <!--  Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Accueil</a></li>
                        <li class="active">Espace membre <txp:cbe_frontauth_whois type="RealName"/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content container-fluid">
            </div>
        </div>

		</txp:if_category>

	<txp:else /> <!-- if article_list -->

		    <div class="main-content">
				<txp:article>
            <div class="page-header">
                <div class="header-left-panel">
                    <!--  Title Page -->
                    <h1 class="page-title"><txp:title/></h1>
                    <!--  Breadcrumb Section -->
                    <ol class="breadcrumb">
                        <li><a href="/index.php?s=membre">Home</a></li>
                        <li class="text-info"><txp:title/></li>
                    </ol>
                </div>
            </div>
            <div class="page-content container-fluid">
							<div class="row">
								<div class="col-md-4">
									<txp:if_article_image><txp:article_image width="0" height="0" class="img-responsive" /><txp:else /><img src="/assets/images/image/img_900x600.jpg" alt="" class="img-responsive"/></txp:if_article_image>
								</div>
								<div class="col-md-8">
									<txp:body />
								</div>

							</div>
            </div>
					</txp:article>
        </div>	


	</txp:if_article_list>

        <!-- End Contain Section -->
        <!-- Start Footer Section -->
        <footer class="main-footer">
            <div class="footer-copyright">
                © 2017 BniDarek
            </div>
            <div class="footer-right-text">
                All Rights Reserved.
            </div>
        </footer>

        <!--  End Site Right Setting Section -->        <!-- End Footer Section -->
        <!-- Global Plugin JavaScript -->
        <script src="/assets/js/global/jquery.min.js"></script>
        <script src="/assets/js/global/bootstrap.min.js"></script>
        <script src="/assets/plugin/bootstrap-tour/js/bootstrap-tour.js"></script>
        <script src="/assets/js/global/waves.min.js"></script>
        <script src="/assets/js/switchery/jQuery.switchery.min.js"></script>
        <script src="/assets/js/full-screen-page/screenfull.min.js"></script>
        <script src="/assets/js/home-page/jquery-slidePanel.min.js"></script>
        <script src="/assets/js/home-page/sidebar.min.js"></script>
        <!-- Global Template JavaScript -->
        <script src="/assets/js/global/site.min.js"></script>
        <script src="/assets/js/sitesettings/site-settings.js"></script>
        <script src="/assets/js/global/site_menu_left.js"></script>
				<script src='/assets/js/simpleCart.min.js'></script>
				<!-- Page Plugin JavaScript -->
        <script src="/assets/plugin/magnific-popup/js/jquery.magnific-popup.min.js"></script>
				<script src="/assets/js/media/media.min.js"></script>
				<script src="/assets/js/footable/footable.all.min.js" type="text/javascript"></script>
        <script src="/assets/js/footable/footable.min.js" type="text/javascript"></script>
        <script src="/assets/js/invoice-print/jQuery.print.js" type="text/javascript"></script>

				<!-- Page Plugin JavaScript -->
        <script src="/assets/js/datatable/datatables.min.js"></script>
        <script src="/assets/js/datatable/datatables.bootstrap.js"></script>
        <script src="/assets/js/datatable/dataTables.responsive.min.js"></script>
        <script src="/assets/js/datatable/responsive.bootstrap.min.js"></script>
        <script src="/assets/js/editable-table/mindmup-editabletable.js"></script>
        <script src="/assets/js/editable-table/numeric-input-example.js"></script>

				<script src="/assets/js/editable-table/editable-table.min.js"></script>
        <script src="/assets/js/datatable/custom.js"></script>

				<script>
				simpleCart.ready( function(){
					simpleCart.currency({ 
							code: "DA" ,
							name: "Dinars Algérien" ,
							symbol: "DA",
							after: true
					});

					simpleCart({
						// array representing the format and columns of the cart,
						// see the cart columns documentation
						cartColumns: [
//							{ attr: "id", label: "ID"},
//							{ attr: "name", label: "Nom"},
//							{ view: "currency", attr: "price", label: "Prix"},
//							{ view: "decrement", label: false},
//							{ attr: "quantity", label: "Qté"},
//							{ view: "increment", label: false},
//							{ view: "currency", attr: "total", label: "SousTotal" },
//							{ view: "remove", label: false},

							{ view: function(item, column){
									return '<div class="list-group-item" role="menuitem"><div class="media"><div class="media-left padding-right-10"><i class="icon icon_documents_alt bg-red white icon-circle" aria-hidden="true"></i></div><div class="media-body"><h6 class="media-heading">'+item.get('desc')+'</h6><span class="media-meta"> Qté '+item.get('quantity')+'</span></div><div class="media-right"><div class="btn-group"><span class="item-remove"><a class="simpleCart_remove" href="javascript:;"><i class="icon fa-close"></i></a></span></div></div></div></div>';
							}, attr: 'custom' },
							{ view: function(item, column){
									return '<table class="table table-bordered"><thead><tr><th class="text-center">DÉSIGNATION</th><th>FOURNISSEUR</th><th>QUANTITÉE</th><th>PRIX</th><th>SUPPR.</th></tr></thead><tbody><tr><td>'+item.get('desc')+'</td><td>'+item.get('fournisseur')+'</td><td><a href="javascript:;" class="simpleCart_decrement"><i class="icon fa-minus-circle"></i></a> <input value="'+item.get('quantity')+'" class="simpleCart_input" type="text"> <a href="javascript:;" class="simpleCart_increment"><i class="icon fa-plus-circle" aria-hidden="true"></i></a></td><td>'+item.get('price')+'</td><td><a class="simpleCart_remove" href="javascript:;"><i class="icon fa-close"></i></a></td></tr></tbody></table>';
							}, attr: 'custom1' }

						],

						// "div" or "table" - builds the cart as a 
						// table or collection of divs
						cartStyle: "div", 

						// how simpleCart should checkout, see the 
						// checkout reference for more info 
						checkout: { 
							type: "SendForm" , 
							url: "http://bnidarek.com/index.php?s=membre&c=checkout1" 
						},

						// set the currency, see the currency 
						// reference for more info
						currency: "DA",

						// collection of arbitrary data you may want to store 
						// with the cart, such as customer info
						data: {},

						// set the cart langauge 
						// (may be used for checkout)
						language: "english-us",

						// array of item fields that will not be 
						// sent to checkout
						excludeFromCheckout: [],

						// custom function to add shipping cost
						shippingCustom: null,

						// flat rate shipping option
						shippingFlatRate: 0,

						// added shipping based on this value 
						// multiplied by the cart quantity
						shippingQuantityRate: 0,

						// added shipping based on this value 
						// multiplied by the cart subtotal
						shippingTotalRate: 0,

						// tax rate applied to cart subtotal
						taxRate: 0,

						// true if tax should be applied to shipping
						taxShipping: false

					});

				});

				$( document ).ready(function() {
					$(".simpleCart_empty").click(function() {
						simpleCart.empty();
					});

					$(".simpleCart_items").on("click", ".simpleCart_remove", function(event){
						// simpleCart.update();
						simpleCart.find(simpleCart.$(this).closest('.itemRow').attr('id').split("_")[1]).remove();
						//simpleCart.find(simpleCart.$(this).closest('.item-id').val()).remove();
						console.log($(this).closest('.itemRow').attr('id').split("_")[1] + "Enlevé");
					});

					$(".simpleCart_items").on("click", ".simpleCart_increment", function(event){
						// simpleCart.update();
						// simpleCart.find(simpleCart.$(this).closest('.itemRow').attr('id').split("_")[1]).increment();
						console.log( simpleCart.$(this).closest('.itemRow').attr('id').split("_")[1] + " increment" );
					});

					$(".simpleCart_checkout").on("click", "", function(event){
						simpleCart.checkout();
					});

					simpleCart.bind( "afterAdd" , function( item ){
						console.log( item.get("id") + " was added to the cart!" );
					});


				});

				</script>
    </body>

	<txp:else /> <!-- cbe level 5 -->


		<txp:article pgonly="1"/>
   <body class="login-form login-form-3">
        <div class="main-login-form">
            <div class="content-login">
                <div class="logo-title logo-login2">
                    <!-- Template Logo -->
                    <span>BniDarek</span>
                </div>

                <div class="login-page login-second-page">
                    <!-- Start Login Form -->
										<txp:cbe_frontauth_login invite="" tag_error="span" class_error="error" class="form-login" id_class="form1">

                        <div class="input-box input-box-login2">
                            <div class="left-icon-login btn-info"><i class="icon fa-user"></i></div>
                            <div class="textbox-login"><input id="name" name="p_userid" class="form-control type="text" value="" placeholder="Nom utilisateur"/></div>
                        </div>
                        <div class="input-box input-box-login2">
                            <div class="left-icon-login btn-info"><i class="icon icon_lock"></i></div>
                            <div class="textbox-login"><input id="password" name="p_password" type="password" value="" class="form-control" placeholder="Mot de passe"/></div>
                        </div>
                        <div class="bottom-login">
                            <div class="remember-text-login remember-register-3">
                                <span class="checkbox-custom checkbox-primary">
																		<input class="checkbox all-selectable" id="stay" name="p_stay" type="checkbox" value="1" />
                                    <label for="stay">Se souvenir de moi</label>
                                </span>
                            </div>
                        </div>
                        <div class="form-group">
														<input class="btn btn-info btn-sign waves-effect waves-dark" type="submit" value="Entrez" />
                        </div>

										</txp:cbe_frontauth_login>
                    <div class="sign-up-text sign-up-login2 remember-register-3">Pour créer un compte cliquez sur ce <a class="underline" href="#">lien</a>.</div>
                    <!-- End Login Form -->
                </div>

            </div>
        </div>
        <!-- Global Plugin JavaScript -->
        <script src="/assets/js/global/jquery.min.js"></script>
        <script src="/assets/js/global/bootstrap.min.js"></script>
        <script src="/assets/plugin/bootstrap-tour/js/bootstrap-tour.js"></script>
        <script src="/assets/js/global/waves.min.js"></script>
        <!-- Global Template JavaScript -->
        <script src="/assets/js/global/site.min.js"></script>
        <!-- Page Template JavaScript -->
        <script src='/assets/js/validation/jquery.validate.min.js'></script>
        <script src='/assets/js/validation/validation.js'></script>
    </body>		

	</txp:cbe_frontauth_protect> <!-- cbe level 5 -->
	</txp:cbe_frontauth_protect> <!-- cbe level 6 -->
</html>

Offline

#5 2017-02-06 11:34:19

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hi

I deleted <txp:hide> in the code and it works now!!

Really strange!

Offline

#6 2017-02-06 11:41:55

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

No luck the error is back after adding some code!!

Offline

#7 2017-02-06 12:58:01

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hi

I splitted the code using txp:form and it seems to work like this. Ihate having such unpredictable bugs like this!

Hope that will continue to work.

Offline

#8 2017-02-06 14:22:51

etc
Developer
Registered: 2010-11-11
Posts: 5,396
Website GitHub

Re: Error i cant debug

Your page seems to work for me, but I don’t see any mention of <txp:cbe_frontauth_if_logged> tag present in your OP debug info?

Offline

#9 2017-02-07 07:05:16

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hi Oleg

<txp:cbe_frontauth_if_logged> is part of cbe_front_auth plugin.

When i have time i will try tu put the code on local server and make more tests to try to see what s going on and see if i can find a way to make the case reproductible to see where the problem is, but right now i must finish the job and txp:output_form solved the problem for me.

Thanks for you help.

Offline

#10 2017-02-14 10:27:06

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hello i finaly found what was the problem!

The page table of textpattern is set to “text” that can handle only 65 535 char and my code is above that then putting that into some form can solve that.

But for modern template i think it s not enough, devs should think to use mediumtext instead.

Cheers.

Offline

#11 2017-02-14 11:03:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,793
Website GitHub

Re: Error i cant debug

Dragondz wrote #304019:

The page table of textpattern is set to “text” that can handle only 65 535 char and my code is above that

It’s bad enough that it’s a text field (which is uncacheable in memory by MySQL). I can’t see it being any more efficient if we increased it to mediumtext.

for modern template i think it s not enough

Really? Can you not offload some of your Page code to Forms? Are each of your Page templates so very different from one another they require 65K of unique code? Anything you can sub-divide into smaller chunks to help reduce Page size and potentially make the site easier to manage?

My <head> segment is often very similar, so I use something like this for most of my Page templates:

<txp:output_form form="head" />
<body>
   <txp:output_form form="navigation" />
  ... specific article body stuff here ...
   <txp:output_form form="page_footer" />
   <txp:output_form form="page_scripts" />
</body>
</html>

Form head:

<!DOCTYPE html>
<html>
<head>
<txp:css format="link" />
<txp:meta_description />
<meta name="generator" content="Textpattern CMS">
<title><txp:page_title /></title>
<txp:if...>
   ... some conditional head content ...
</txp:if>
</head>

So why are your templates so big?


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Online

#12 2017-02-14 11:47:20

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,547
Website GitHub Twitter

Re: Error i cant debug

Hi Steph,

That s what i did, splitting the page into fiew forms, but today i tryed a purchased template and pasting it as is (without any txp tag) get over 77000 chars.

I was trying to work only on the page without using forms to have to look in one place when changing code but with complex website i have a really long page.

Now i know how to solve this issue, it s not a problem for me, i am just wondering if that change is interesting for others that all.

Cheers.

Offline

Board footer

Powered by FluxBB