<?php
session_start();

$var=$_REQUEST['var'];

if($var=="logout"){
//session_unset();
session_destroy();
$_SESSION['USERNAME'] ="";
//echo "<h3>La session est terminée</h3>";
echo "<meta http-equiv='refresh' content='0; url=index.php'>";

}
?>




<!DOCTYPE html>

<html lang="fr" dir="ltr" data-style="basic">
	<head>
    	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

		<style type="text/css">[uib-typeahead-popup].dropdown-menu{display:block;}</style>
		<style type="text/css">.uib-time input{width:50px;}</style>
		<style type="text/css">[uib-tooltip-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-html-popup].tooltip.right-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.top-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-left > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.bottom-right > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.left-bottom > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-top > .tooltip-arrow,[uib-tooltip-template-popup].tooltip.right-bottom > .tooltip-arrow,[uib-popover-popup].popover.top-left > .arrow,[uib-popover-popup].popover.top-right > .arrow,[uib-popover-popup].popover.bottom-left > .arrow,[uib-popover-popup].popover.bottom-right > .arrow,[uib-popover-popup].popover.left-top > .arrow,[uib-popover-popup].popover.left-bottom > .arrow,[uib-popover-popup].popover.right-top > .arrow,[uib-popover-popup].popover.right-bottom > .arrow,[uib-popover-html-popup].popover.top-left > .arrow,[uib-popover-html-popup].popover.top-right > .arrow,[uib-popover-html-popup].popover.bottom-left > .arrow,[uib-popover-html-popup].popover.bottom-right > .arrow,[uib-popover-html-popup].popover.left-top > .arrow,[uib-popover-html-popup].popover.left-bottom > .arrow,[uib-popover-html-popup].popover.right-top > .arrow,[uib-popover-html-popup].popover.right-bottom > .arrow,[uib-popover-template-popup].popover.top-left > .arrow,[uib-popover-template-popup].popover.top-right > .arrow,[uib-popover-template-popup].popover.bottom-left > .arrow,[uib-popover-template-popup].popover.bottom-right > .arrow,[uib-popover-template-popup].popover.left-top > .arrow,[uib-popover-template-popup].popover.left-bottom > .arrow,[uib-popover-template-popup].popover.right-top > .arrow,[uib-popover-template-popup].popover.right-bottom > .arrow{top:auto;bottom:auto;left:auto;right:auto;margin:0;}[uib-popover-popup].popover,[uib-popover-html-popup].popover,[uib-popover-template-popup].popover{display:block !important;}</style>

		<style type="text/css">.uib-datepicker .uib-title{width:100%;}.uib-day button,.uib-month button,.uib-year button{min-width:100%;}.uib-datepicker-popup.dropdown-menu{display:block;float:none;margin:0;}.uib-button-bar{padding:10px 9px 2px;}.uib-left,.uib-right{width:100%}</style>
		<style type="text/css">.uib-position-measure{display:block !important;visibility:hidden !important;position:absolute !important;top:-9999px !important;left:-9999px !important;}.uib-position-scrollbar-measure{position:absolute;top:-9999px;width:50px;height:50px;overflow:scroll;}</style>
		<style type="text/css">.ng-animate.item:not(.left):not(.right){-webkit-transition:0s ease-in-out left;transition:0s ease-in-out left}</style>
		<style type="text/css">@charset "UTF-8";[ng\:cloak],[ng-cloak],[data-ng-cloak],[x-ng-cloak],.ng-cloak,.x-ng-cloak,.ng-hide:not(.ng-hide-animate){display:none !important;}ng\:form{display:block;}.ng-animate-shim{visibility:hidden;}.ng-anchor{position:absolute;}</style>


        <title>admin</title>

        <meta http-equiv="X-UA-Compatible" content="IE=edge">
        <meta name="viewport" content="width=device-width">

        <!-- Chrome, Firefox OS and Opera -->
        <meta name="theme-color" content="#293a4a">

        <!-- Mobile Chrome-->
        <meta name="mobile-web-app-capable" content="yes">
        <meta name="mobile-web-app-status-bar-style" content="default">

        <!-- iOS Safari -->
        <meta name="apple-mobile-web-app-capable" content="yes">
        <meta name="apple-mobile-web-app-status-bar-style" content="default">


        <meta name="referrer" content="origin">

        <link rel="shortcut icon" href="" type="image/x-icon">
        <link rel="stylesheet" type="text/css" href="./dash_files/master-ltr.cmb.min.css">        <link rel="stylesheet" type="text/css" href="./dash_files/chosen.min.css">
        <style type="text/css">                /* Embedding: /usr/local/cpanel/base/frontend/paper_lantern/home/dashboard.min.css */
                .cpanel_body{max-width:none}.panel-widget{border-radius:3px;box-shadow:0 0 3px rgba(0,0,0,0.2);height:auto;border:0;margin-bottom:15px;display:table;width:100%;max-width:100%}.widget-heading{border:1px solid #293a4a;background-color:rgba(41,58,74,0.95);color:#fff;text-transform:uppercase}.widget-heading .close{color:#fff;opacity:1}.widget-draggable{cursor:move}.group-header-indicator{cursor:pointer;padding:13px 20px;margin-top:-11px}html[dir="ltr"] .group-header-indicator{margin-right:-16px}html[dir="rtl"] .group-header-indicator{margin-left:-16px}html[dir="rtl"] .pull-right{float:left!important}.alert-list{margin:0;padding:0;width:100%}.alert-item{padding:0 8px;display:inline-block;width:50%;vertical-align:top;float:left;zoom:1;*display:inline}html[dir="rtl"] .alert-item{float:right}@media(max-width:767px){.alert-item{width:100%;padding:0 8px}}.drag{opacity:.5}.drag+.drag-over,#content .drag-hidden{margin:0;height:0;outline-style:none}.drag-over{outline-style:dashed;height:80px;margin:10px 0}.drop-area{padding:5px 0}#jump-search{margin-bottom:5px}.icon-menu-section{margin-bottom:5px}@keyframes minimize{0%{max-height:75000px}1%{max-height:1000px}100%{max-height:0}}@keyframes maximize{0%{max-height:0}99%{max-height:1000px}100%{max-height:75000px}}.panel-body.minimized{max-height:0}.panel-body.minimize{animation:minimize .4s}.panel-body{padding:15px;overflow:hidden}.widget-collapsible{max-height:75000px;padding:0}.widget-collapsible.maximize{animation:maximize 1.4s}.icon-container-body{padding:15px;clear:both;margin-left:0;margin-right:0;width:100%}.item{float:left;height:60px;padding:0;text-align:left}html[dir="rtl"] .item{text-align:right;float:right}.icon{display:block;margin:auto}.itemContentWrapper{padding:0;width:100%}.itemImageWrapper{display:inline-block;vertical-align:middle}.itemTextWrapper{padding:10px 0 10px 5px;display:inline-block;vertical-align:middle;width:200px}html[dir="rtl"] .itemTextWrapper{padding:10px 5px 10px 0}.icon-menu-section .close,.icon-menu-section .close:hover,.icon-menu-section .close:active,.icon-menu-section .close:focus{opacity:1;color:#fff}@media(min-width:992px){html[dir="ltr"] #stats{padding-left:0}html[dir="rtl"] #stats{padding-right:0}}.app-name{text-transform:capitalize;padding:0 0 5px 0;display:block;word-break:break-all}.general-info-label{text-transform:capitalize;display:block}.general-info-value{display:block}.progress{margin:5px 0 5px 0}.progress-bar-disabled{background-color:#b2b2b2}.progress{height:4px;border-radius:0;box-shadow:none;background:#c8c8c8}.progress .progress-bar{box-shadow:none}.warning .app-stat-upgrade .fa-exclamation-triangle{color:#8a6d3b}.danger .app-stat-upgrade .fa-exclamation-triangle{color:#a94442}.success .progress-bar{background-color:#5cb85c}.info .progress-bar{background-color:#5bc0de}.warning .progress-bar{background-color:#f0ad4e}.danger .progress-bar{background-color:#d9534f}#statsSection tr.success.app-stat-row>td,#statsSection tr.info.app-stat-row>td{box-shadow:none}#statsSection tr.success td,#statsSection tr.info td{background:0}#statsSection .app-stat-upgrade{width:50px;padding:0;line-height:75px;text-align:center}html[dir="ltr"] #statsSection .stats-parenthetical-percentage{display:inline-block;padding-left:.5em}html[dir="rtl"] #statsSection .stats-parenthetical-percentage{display:inline-block;padding-right:.5em}.app-stat-upgrade a{display:none;height:100%;width:100%;text-align:center;color:#fff;background-color:#428bca}.warning>.app-stat-upgrade a i,.danger>.app-stat-upgrade a i{vertical-align:middle}.warning>.app-stat-upgrade a,.danger>.app-stat-upgrade a{display:inline-block}.updating-elements{display:inline-block}                /* Embedding: /usr/local/cpanel/base/frontend/paper_lantern/css/angular-chosen-spinner.min.css */
                .localytics-chosen.loading+.chosen-container-multi .chosen-choices{background-image:url('images/spinner.gif');background-repeat:no-repeat;background-position:98%}html[dir="rtl"] .localytics-chosen.loading+.chosen-container-multi .chosen-choices{background-position:2%}.localytics-chosen.loading+.chosen-container-single .chosen-single span{background:url('images/spinner.gif') no-repeat right}html[dir="rtl"] .localytics-chosen.loading+.chosen-container-single .chosen-single span{background:url('images/spinner.gif') no-repeat left}.localytics-chosen.loading+.chosen-container-single .chosen-single .search-choice-close{display:none}        </style>
        <!-- custom style css file (styles.css) should go here
             NOTE: Do not move below the header JS or you delay the
             download start time. These just need to be below the
             last css in the header. -->
        <link rel="stylesheet" type="text/css" href="./dash_files/icon_spritemap.css">
        <link rel="stylesheet" type="text/css" href="./dash_files/styles.css">








<!-- We want to load the appGroups as soon as possible so that
     the sea of icons can start rendering as soon as possible -->






        <!-- UI INCLUDES GLOBAL HTML HEAD -->
                <!-- UI INCLUDES GLOBAL HTML HEAD END -->
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="app/index.dist" src="./dash_files/index.dist.min.js.téléchargement"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="frameworksBuild" src="./dash_files/frameworks.cmb.js.téléchargement"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="locale" src="./dash_files/locale.js.téléchargement"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="app/index.cmb" src="./dash_files/index.cmb.min.js.téléchargement"></script><script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="master/master.cmb" src="./dash_files/master.cmb.min.js.téléchargement"></script>
<script type="text/javascript" charset="utf-8" async="" data-requirecontext="_" data-requiremodule="/cPanel_magic_revision_1563307475/frontend/paper_lantern/libraries/cjt2-dist/cjt2.cpanel.cmb.min.js?locale=fr&amp;locale_revision=1561666758" src="./dash_files/cjt2.cpanel.cmb.min.js.téléchargement"></script>

</head>


<body>

<?php
   include("connexion.php");
?>


<div id="bodyWrapper">

<div id="header">
<div class="header-wrapper">
    <div class="header-top">
        <div class="container">
            <div class="row">
                    <div class="topRow">
<center>
 <div id="" style="margin-top:0px">
<a href="index.php">
    <img src="logo/logo.png" alt="DieuExiste" title="DieuExiste" width="200"></a>
    </div>
    </center>
              </div>
          </div>
        </div>
    </div>
	</div>
</div>


<div class="content-wrapper">
	<div id="bodyContent">
    <!-- header wrapper end -->
	<div class="container">
	  <div class="row">
	        	<div id="centerColumn" class="col-xs-12">

<center><h2 class="page-heading">MENU DE CONNEXION</h2></center>

<center>

<form action="<?php $_SERVER['PHP_SELF'] ?>" method="post" enctype="application/x-www-form-urlencoded">
<fieldset>
<table>
	<tbody>
    	<tr>
        	<td style="font-size:18px" width="120px" height="50px"><b>Utilisateur</b></td>
        	<td width="200px"><input type="text" size="30px" name="username"/></td>
        </tr>

        <tr>
        <td style="font-size:18px" width="120px" height="50px"><b>Mot de passe</b></td>
        <td width="200px"><input type="password" size="30px" name="password"/></td>
        </tr>
    </tbody>
</table>

        <input type="submit" class="cart btn btn-primary" class="info btn btn-default" name="envoi" value="CONNEXION" />
        <input type="submit" class="cart btn btn-primary" class="info btn btn-default" name="envoi" value="ANNULER" />
</fieldset>
</form>


<?php
//CONNEXION
$Username=isset($_POST["username"]);
$Password=isset($_POST["password"]);
$var=isset($_POST["envoi"]);
/*
echo $var,'<br/>';
echo $code,'<br/>';
echo $article,'<br/>';
echo $prix,'<br/>';
*/

if($var==""){

}

else{
if($_POST["envoi"]=="CONNEXION")
{
$Username=$_POST["username"];
$Password= $_POST["password"];

$info="SELECT * FROM adm_user WHERE username='$Username'";
$USERNAME="";
foreach($connexion->query($info) as $row){
$USERNAME=$row['username'];
$PASSWORD=$row['password'];
//$PHOTO=$user->photo;
$STATUS=$row['status'];
}

//$_SESSION['username']= $_SESSION['username']."//".$Username;
//$_SESSION['password']= $_SESSION['password']."//".$Password;


if($STATUS=="Yes"){
if(!$USERNAME==""){

if(($Username==$USERNAME) && ($Password==$PASSWORD)){
//administrateur_user.php
$_SESSION['USERNAME'] = $USERNAME;
//$_SESSION['PHOTO'] = $PHOTO;

echo "<meta http-equiv='refresh' content='0; url=dashboard.php'>";
}

else{
echo "<script type=\"text/javascript\">alert (\"Les informations saisies sont incorrectes !\")</script>";
}

}
else{
echo "<script type=\"text/javascript\">alert (\"L'Utilisateur $Username n'est pas reconnu !\")</script>";
}
}

else{
echo "<script type=\"text/javascript\">alert (\"L'Utilisateur $Username n'a pas l'accès !\")</script>";
}

}


}

//VERIFIER
if($var==""){

}

else{
if($_POST["envoi"]=="VERIFIER")
{
echo "<table border=\"1\" >";
echo "<tr><td colspan=\"3\"><b>Récapitulatif de votre commande</b></td>";
echo "<tr><th>&nbsp;code&nbsp;</th><th>&nbsp;article&nbsp;</ th><th>&nbsp;
prix&nbsp;</th>";
$total=0;
$tab_code=explode("//",$_SESSION['code']);
$tab_article=explode("//",$_SESSION['article']);
$tab_prix=explode("//",$_SESSION['prix']);
$prixtotal=0;

for($i=1;$i<count($tab_code);$i++)
{
echo "<tr> <td>{$tab_code[$i]}</td> <td>{$tab_article[$i]}</td><td>".sprintf("%01.2f", $tab_prix[$i])."</td>";
$prixtotal+=$tab_prix[$i];
}
echo "<tr> <td colspan=2> PRIX TOTAL </td> <td>".sprintf("%01.2f", $prixtotal)."</td>";
echo "</table>";
}

}

//ENREGISTRER
if($var==""){

}

else{
if($_POST["envoi"]=="ENREGISTRER")
{
$idfile=fopen("commande.txt",w);
//
$tab_code=explode("//",$_SESSION['code']);
$tab_article=explode("//",$_SESSION['article']);
$tab_prix=explode("//",$_SESSION['prix']);
for($i=0;$i<count($tab_code);$i++)

{
fwrite($idfile, $tab_code[$i]." ; ".$tab_article[$i]." ; ".$tab_prix[$i].";
\n");
}
fclose($idfile);
}

}
//VIDER LE PANIER
if($var==""){

}

else{
if($_POST["envoi"]=="VIDER LE PANIER")
{
session_unset();
session_destroy();
echo "<h3>La session est terminée</h3>";

}

}
$_POST["envoi"]="";

?>
</center>

<br/>
<br/>
</div>

</div>
</div>



<!--    <div class="scroll-wrap" id="scroll-01">
    <div class="simply-scroll simply-scroll-container">

    <div class="simply-scroll-clip"><ul style="width: 38191px; margin-right:auto;" class="scroller simply-scroll-list">

              <?php
/*$mld1=mysql_query("SELECT * FROM uac_brands ");

while($rst4= mysql_fetch_object($mld1)){
$IMG_BRANDS=$rst4->brnd_file;
echo "<li><img src=\"img/partenaire/$IMG_BRANDS\" width=\"98%\"></li>";
}
*/
?>

              </ul>
              </div>
    </div>
    </div>-->




<!-- content-wrapper -->
<div class="footer-wrapper">
        	<div class="container">
	            <div class="row">

<div class="container well">
	<div class="footer">


			<div class="footer-boxes">
                            <div class="row">
                            <br/>
                            <div style="background-color:#CCCCCC;">
                                <?php include("footer.php"); ?>
                            </div>

            </div>
                 </div>
    </div>
</div>
             </div>
</div>
<!-- bodyWrapper //-->

<script type="text/javascript">/* CloudFlare analytics upgrade */
</script>
<script type="text/javascript">window.NREUM||(NREUM={});NREUM.info={"beacon":"bam.nr-data.net","licenseKey":"72d7dcce33","applicationID":"1388850","transactionName":"ZV1TZ0FTVkFVWkwKXlwXZEFaHVdBV2YNVgEBDx5aXVZdShpJUBM=","queueTime":0,"applicationTime":2031,"atts":"SRpQEQlJRU8=","errorBeacon":"bam.nr-data.net","agent":""}</script><noscript><iframe src="" height="0" width="0" style="display:none;visibility:hidden"></iframe></noscript> <script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push( {'gtm.start': new Date().getTime(),event:'gtm.js'} );var f=d.getElementsByTagName(s)[0], j=d.createElement(s),dl=l!='dataLayer'?'&l='+l:'';j.async=true;j.src=''+i+dl;f.parentNode.insertBefore(j,f); })(window,document,'script','dataLayer','GTM-N7VWVN');</script> <!-- End Google Tag Manager --></div></div></div>
</div><div style="display: none;" id="cboxOverlay"></div><div style="display: none;" tabindex="-1" role="dialog" class="" id="colorbox"><div id="cboxWrapper"><div><div style="float: left;" id="cboxTopLeft"></div><div style="float: left;" id="cboxTopCenter"></div><div style="float: left;" id="cboxTopRight"></div></div><div style="clear: left;"><div style="float: left;" id="cboxMiddleLeft"></div><div style="float: left;" id="cboxContent"><div style="float: left;" id="cboxTitle"></div><div style="float: left;" id="cboxCurrent"></div><button id="cboxPrevious" type="button"></button><button id="cboxNext" type="button"></button><button id="cboxSlideshow"></button><div style="float: left;" id="cboxLoadingOverlay"></div><div style="float: left;" id="cboxLoadingGraphic"></div></div><div style="float: left;" id="cboxMiddleRight"></div></div><div style="clear: left;"><div style="float: left;" id="cboxBottomLeft"></div><div style="float: left;" id="cboxBottomCenter"></div><div style="float: left;" id="cboxBottomRight"></div></div></div><div style="position: absolute; width: 9999px; visibility: hidden; display: none; max-width: none;"></div></div>
<div id="fancybox-wrap"><div id="fancybox-outer"><div class="fancybox-bg" id="fancybox-bg-n"></div><div class="fancybox-bg" id="fancybox-bg-ne"></div><div class="fancybox-bg" id="fancybox-bg-e"></div><div class="fancybox-bg" id="fancybox-bg-se"></div><div class="fancybox-bg" id="fancybox-bg-s"></div><div class="fancybox-bg" id="fancybox-bg-sw"></div><div class="fancybox-bg" id="fancybox-bg-w"></div><div class="fancybox-bg" id="fancybox-bg-nw"></div>
    <a href="javascript:;" id="fancybox-left"><span class="fancy-ico" id="fancybox-left-ico"></span></a><a href="javascript:;" id="fancybox-right"><span class="fancy-ico" id="fancybox-right-ico"></span></a></div>
</div>

</div>
</body><!-- Google Tag Manager --></html>