function compare_date($idcontrat, $date_resiliation) { global $db; $date_resiliation = date('Y-m-d-', strtotime($date_resiliation)); if (!$db->Query("SELECT * from contrat_location_villa where id=" . tp('idcontrat'))) { $db->Kill($db->Error()); } $array = $db->RowArray(); if ($date_resiliation > $array['date_debut'] && $date_resiliation < $array['date_fin']) { return true; } else { return false; } }
<?php if (tp('verif') == 1) { global $db; $depense_id = tp('depense1'); model::load('depense', 'paiement_dep'); if (!add_paiement_dep($depense_id, tp('ficheid'), tp('pjsid'), tp('ncheque'), tp('remarque'))) { exit("2#Erreur Système"); } else { exit("1#Enregistrement réussi"); } }
<?php if (tp('verif') == 1) { model::load('synthese', 'editsynthese'); if (!editsyn(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('id'), tp('dat'))) { exit("0"); } else { exit("1"); } } else { view::load('synthese', 'editsynthese'); }
<?php if (tp('verif') == 1) { global $db; //Check if id corespond nom $datedebut = new DateTime(tp('date_debut')); $datefin = new DateTime(tp('date_fin')); if ($datedebut >= $datefin) { exit("0"); } model::load('recette', 'editlocation'); if (!editlocation(tp('id'), tp('nom'), tp('adresse'), tp('pjid'), tp('tel'), tp('email'), tp('villa'), tp('date_debut'), tp('date_fin'), tp('type_paiement'), tp('montant_location'), tp('agarantie_location'))) { exit("1"); } else { exit("2"); } } else { view::load('recette', 'editlocation'); }
<?php if (tp('verif') == 1) { //verif si il y a une image. if (tp('photoid') != '') { $img = tp('photoid'); } else { $img = ''; } $nextid = getnextidtable('contenu'); model::load('contenu', 'addcontenu'); if (!addcontenu(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('modul'), $img, $nextid, tp('vod'), tp('fileuploadid'), tp('dat'))) { exit("0"); } else { exit("1"); } } else { view::load('contenu', 'addcontenu'); }
?> </h1> <?php global $db; $records_per_page = 100; $pagination = new pagination(); if (!$db->Query("SELECT id , titr" . LANG . " as titre ,document ,dat , modul from contenu where titr" . LANG . " LIKE '%" . tp('mot') . "%' or cont" . LANG . " LIKE '%" . tp('mot') . "%' order by id DESC ")) { $db->Kill('Error1s'); } if ($db->RowCount() > 0) { $totalrow = $db->RowCount(); if (!$db->Query("SELECT id , titr" . LANG . " as titre ,document ,dat , modul from contenu where titr" . LANG . " LIKE '%" . tp('mot') . "%' or cont" . LANG . " LIKE '%" . tp('mot') . "%' order by id DESC limit " . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page)) { $db->Kill('Error1s'); } $pagination->records($totalrow); $pagination->records_per_page($records_per_page); ?> <div class="sidebar"> <!-- ################################################################################################ --> <article> <nav class="sdb_holder"> <ul> <?php while (!$db->EndOfSeek()) { $row = $db->Row();
<?php global $db; if (tp('del') == 1) { $id_villa = tp('lin'); //Check if have contrat $nbr_contrat = $db->QuerySingleValue0("select count(id) from contrat_location_villa where idvilla= {$id_villa} "); if ($nbr_contrat > 0) { exit("2#{$nbr_contrat}"); } model::load('gestionvilla', 'gestionvilla'); //Execute Model if (!delet($id_villa)) { exit("3"); //Error opération } else { exit("1"); //Success Opération } } $nextid = getnextidtable('contrat_location_villa'); $session = new session(); $session->set('nextid', $nextid); view::load('gestionvilla', 'gestionvilla');
//Success Opération } } else { if (tp('show') == 1) { $id_vod = tp('lin'); model::load('vod', 'vod'); //Execute Model if (!showvod($id_vod)) { exit("2#Erreur Système"); //Error opération } else { exit("1#Suppression réussie"); //Success Opération } } else { if (tp('arch') == 1) { $id_vod = tp('lin'); model::load('vod', 'vod'); //Execute Model if (!archvod($id_vod)) { exit("2#Erreur Système"); //Error opération } else { exit("1#Suppression réussie"); //Success Opération } } else { view::load('vod', 'vod'); } } }
<?php if (tp('verif') == 1) { $service = cryptage($_SESSION['service'], 0); $usrid = $_SESSION['userid']; model::load('admin', 'editcompte'); if (tp('password') != null) { if (!$db->Query("SELECT * FROM users_sys where id={$usrid} and pass='******'passwordi')) . "'")) { $db->Kill('Error1'); } if ($db->RowCount() > 0) { if (!edituser(tp('firstname'), tp('lastname'), tp('password'), tp('tel'), tp('email'))) { exit("2"); } else { exit("1"); } } else { exit("3"); } } else { if (!edituser(tp('firstname'), tp('lastname'), tp('password'), tp('tel'), tp('email'))) { exit("2"); } else { exit("1"); } } } else { view::load('admin', 'editcompte'); }
<?php // function dynselect($nam,$tabl,$id,$ord, $txt,$indx=NULL,$class=NULL,$selected=NULL,$multi=NULL,$where=NULL ) //Usage get select Articl par chapitre if (tp('tab') == "artic") { $table = tp('id'); $output = '<label class="control-label">Article :</label> <div class="controls">'; $output .= dynselect("article", $table, "id", "id", 'titrfr', "[Choisir un Article]", "span8", "", ""); $output .= '</div>'; exit($output); }
<?php if (tp('verif') == 1) { $id_paragraphe = tp('id_par'); $id_article = tp('article'); $id_chapitre = tp('chapitre'); $titr_paragraphe = tp('titre'); $montant = tp('montant'); //Exist Montant Article and Chapitre used for update Montant $exist_montant = $db->QuerySingleValue0("select montant from paragraphe where id = {$id_paragraphe}"); $exist_article = $db->QuerySingleValue0("select id_article from paragraphe where id = {$id_paragraphe}"); $exist_chapitre = $db->QuerySingleValue0("select id_chapitre from article where id = {$exist_article}"); //Check if have same Titre and same Article $titr_paragraphe_sql = str_replace(' ', '', $titr_paragraphe); $nbr_paragraphe_exist = $db->QuerySingleValue0("select count(id) from paragraphe where REPLACE(titre, ' ','') = '{$titr_paragraphe_sql}' and paragraphe.id_article = {$id_article} AND id <> {$id_paragraphe} "); if ($nbr_paragraphe_exist > 0) { exit("3#{$nbr_paragraphe_exist}"); } model::load('budget', 'budget'); if (!edit_paragraphe($id_paragraphe, $id_chapitre, $id_article, $titr_paragraphe, $montant, $exist_article, $exist_chapitre, $exist_montant)) { exit("2"); } else { exit("1"); } } else { view::load('budget', 'editparagraphe'); }
<?php if (tp('verif') == 1) { $paragraphe_s = tp('id_par'); $article_s = $db->QuerySingleValue0("select id_article from paragraphe where id = {$paragraphe_s}"); $chapitre_s = $db->QuerySingleValue0("select id_chapitre from article where id = {$article_s}"); $paragraphe_d = tp('paragraphe'); $article_d = tp('article'); $chapitre_d = tp('chapitre'); $mont_ajout = tp('mont_ajout'); //Check Montant plus disponible source $exist_montant_dsipo = $db->QuerySingleValue0("select mont_disp from paragraphe where id = {$paragraphe_s}"); if ($exist_montant_dsipo < $mont_ajout) { exit("2#Le montant à ajouter dépasse le montant source {$exist_montant_dsipo} {$mont_ajout} "); } //Check if Paragraphe source same at Destination if ($paragraphe_s == $paragraphe_d) { exit("3#Le paragraphe destionation doit être différent de paragraphe Source"); } //($paragraphe_s,$article_s,$chapitre_s,$paragraphe_d,$article_d,$chapitre_d,$mont) model::load('budget', 'budget'); if (!amenagement_budget($paragraphe_s, $article_s, $chapitre_s, $paragraphe_d, $article_d, $chapitre_d, $mont_ajout)) { exit("2"); } else { exit("1"); } } view::load('budget', 'amenagement');
<?php if (tp('verif') == 1) { global $db; model::load('quotpatronal', 'editquote'); $date = tp('date'); $datee = tp('datee'); $datetime1 = new DateTime($date); $datetime2 = new DateTime($datee); if ($datetime1 != $datetime2) { if (verif_quot($date)) { exit("3"); } else { if (!edit_quote(tp('id'), tp('date'), tp('montant'), tp('pjid'))) { exit("2"); } else { exit("1"); } } } else { if (!edit_quote(tp('id'), tp('date'), tp('montant'), tp('pjid'))) { exit("2"); } else { exit("1"); } } } view::load('quotpatronal', 'editquote');
<?php if (tp('del') == 1) { $id_personnel = tp('lin'); //vérification sur table avance $fullquery = "select * from avance_salaire where id_salarie = {$id_personnel} "; if (!$db->Query($fullquery)) { $db->Kill($db->Error()); } if ($db->RowCount() > 0) { exit("0#Suppression Impossible"); } //vérification sur table salaire $fullquery = "select * from salaire where id_salarie = {$id_personnel} "; if (!$db->Query($fullquery)) { $db->Kill($db->Error()); } if ($db->RowCount() > 0) { exit("0#Suppression Impossible"); } model::load('salarie', 'salarie'); //Execute Model if (!delet_personnel($id_personnel)) { exit("2#Erreur Système"); //Error opération } else { exit("1#Suppression réussie"); //Success Opération } } else { view::load('salarie', 'salarie');
<?php if (tp('verif') == 1) { if (tp('captcha') != $_SESSION['Captcha']) { $messageok = 0; } else { model::load('page', 'contact'); if (!addmail(tp('name'), tp('email'), tp('to'), tp('sujet'), tp('message'), tp('ip'))) { $messageok = 1; } else { //session_start(); function ChaineAleatoire($nbcar) { $chaine = 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789'; srand((double) microtime() * 1000000); $variable = ''; for ($i = 0; $i < $nbcar; $i++) { $variable .= $chaine[rand() % strlen($chaine)]; } return $variable; } if (isset($_SESSION['Captcha'])) { unset($_SESSION['Captcha']); } $_SESSION['Captcha'] = ChaineAleatoire(5); $messageok = 2; } } define('MAILSTAT', $messageok); view::load('page', 'contact'); } else {
<?php if (tp('verif') == 1) { model::load('villa', 'addvilla'); if (!addvilla(tp('nom'), tp('adresse'), tp('prix'))) { exit("0"); } else { exit("1"); } } else { view::load('villa', 'addvilla'); }
<?php if (tp('verif') == 1) { $if = tp('if'); $rs = tp('rs'); //Check if have same Titre and same Chapitre $exist = $db->QuerySingleValue0("select count(id) from fournisseur where `if` = '{$if}' "); if ($exist > 0) { exit("Ce bénificaire existe dans la base de donnée"); } model::load('benificaire', 'benificaire'); if (!add_fournisseur(tp('rs'), tp('nom'), tp('prenom'), tp('adr'), tp('if'), tp('ville'), tp('pays'), tp('tel'), tp('mail'), tp('mobile'), tp('fax'))) { exit("2"); } else { exit("1"); } } else { view::load('benificaire', 'addbenificaire'); }
<?php if (tp('mot') != '') { view::load('page', 'rechercher'); } else { view::load('tdb', 'tdb'); }
$datetime5 = new DateTime($date_start); $montant = $cycle_v * $array['montant']; if ($datetime3 > $datetime4 or $datetime3 == $datetime4) { addcollecte($id_contrat, date('Y-m-d-', strtotime($date_start)), date('Y-m-d-', strtotime($date_end)), $montant, "Payé", date('Y-m-d-', strtotime($date_start))); } else { addcollecte($id_contrat, date('Y-m-d-', strtotime($date_start)), date('Y-m-d-', strtotime($date_end)), $montant, "Non Payé", ''); } } // $reponse = 'ok'; exit("1#Opération réussie"); //Success Opération } } if (tp('del') == 1) { global $db; $id_contrat = tp('lin'); $idvil = tg('id'); $nbr_collecte = $db->QuerySingleValue0("select count(id) from collecte where id_location={$id_contrat}"); model::load('gestionvilla', 'contralocatvila'); if ($nbr_collecte > 0) { if (!deletcollecte($id_contrat)) { exit("2#Erreur Système COL"); } if (!deletcontrat($id_contrat)) { exit("2#Erreur Système CON"); } if (!$db->Query("update villa set contrat=0,statut=0 where id=" . $idvil)) { exit("2#Erreur Système VIL"); } exit("1#Opération réussie"); } else {
$date_contrat = new DateTime(tp("date")); $dat_du_jour = new DateTime(date('d-m-Y')); if ($date_contrat > $dat_du_jour) { exit("2# La Date du Contrat Invalid "); } model::load('contrat', 'editcontrat'); $montant_dispo = $db->QuerySingleValue0("select mont_disp from paragraphe where id = " . tp('paragraphe')); if ($montant_dispo < tp('montant')) { exit("2# Le Montant de contrat dépasse les fonds de la source "); } $nom_fornisseur = str_replace(' ', '', tp('fournisseur')); $id_fournisseur = $db->QuerySingleValue0("select id from fournisseur where REPLACE(rs, ' ','') = '{$nom_fornisseur}' "); if ($id_fournisseur == "0") { exit("3#Ce fournisseur n'existe pas dans la base de données"); } if (!edit_contrat(tp('idcontrat'), tp('titre'), $id_fournisseur, tp('date'), tp('montant'), tp('article'), tp('paragraphe'), tp('chapitre'), tp('pjid'))) { exit("3# Erreur Operation"); } else { exit("1# Opperation reussie"); } } else { view::load('contrat', 'editcontrat'); } ?>
<?php if (isset($_POST['verif']) && $_POST['verif'] == 1) { //verif si il y a une image. if (tp('photoid') != '') { $img = tp('photoid'); } else { $img = ''; } model::load('page', 'editpage'); if (!editpage(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('parent'), $img, tp('id'), tp('titrimgfr'), tp('titrimgar'), tp('ximg'), tp('yimg'))) { exit("0"); } else { exit("1"); } } else { view::load('page', 'editpage'); }
<?php if (tp('verif') == 2) { model::load('admin', 'edituser'); if (!edituser(tp('firstname'), tp('lastname'), tp('service'), tp('tel'), tp('id'), tp('signid'), tp('agence'))) { $reponse = 0; } else { $reponse = 1; } echo $reponse; } else { view::load('admin', 'edituser'); }
} else { if ($dat1 != $dat11) { exit("6"); } else { if ($dat2 != $dat22) { exit("7"); } else { $email = tp('email'); if (empty($email)) { if (!addlocation($nextid, tp('nom'), tp('responsable'), tp('adresse'), tp('tel'), "", tp('villa'), tp('dated'), tp('datef'), tp('montant'), tp('depot'), tp('pjid'), $cycle_name)) { exit("2"); } else { $db->Query("update villa set statut=2 where id=" . tp('villa')); exit("1"); } } else { if (!addlocation($nextid, tp('nom'), tp('responsable'), tp('adresse'), tp('tel'), $email, tp('villa'), tp('dated'), tp('datef'), tp('montant'), tp('depot'), tp('pjid'), $cycle_name)) { exit("2"); } } } } } } } } else { exit("3"); } } else { view::load('gestionvilla', 'addcontrat'); }
<?php if (tp('verif') == 1) { //verif si il y a une image. model::load('album', 'editalbum'); if (!editalbum(tp('titrfr'), tp('titren'), tp('titrar'), tp('imgid'), tp('id'))) { $reponse = 0; } else { $reponse = 1; } echo $reponse; } else { view::load('album', 'editalbum'); }
//Success Opération } } else { if (tp('show') == 1) { $id_news = tp('lin'); model::load('news', 'news'); //Execute Model if (!shownews($id_news)) { exit("2#Erreur Système"); //Error opération } else { exit("1#Suppression réussie"); //Success Opération } } else { if (tp('arch') == 1) { $id_news = tp('lin'); model::load('news', 'news'); //Execute Model if (!archnews($id_news)) { exit("2#Erreur Système"); //Error opération } else { exit("1#Suppression réussie"); //Success Opération } } else { view::load('news', 'news'); } } }
<?php global $db; $records_per_page = 50; $pagination = new pagination(); $wher = ''; if (tp('annee') != 0) { $wher .= " and year(dat) = " . tp('annee'); } if (tp('jour') != 0) { $wher .= " and DAY(dat) = " . tp('jour'); } if (tp('motcle') != '') { $wher .= " and titr" . LANG . " LIKE '%" . tp('motcle') . "%'"; } if (tp('mois') != 0) { $wher .= " and MONTH(dat) = " . tp('mois'); } if (!$db->Query("SELECT id , titr" . LANG . " as titre ,document ,dat from contenu where titr" . LANG . " IS NOT NULL and modul=" . tg('id') . " {$wher} order by id DESC ")) { $db->Kill('Error1s'); } if ($db->RowCount() > 0) { $totalrow = $db->RowCount(); if (!$db->Query("SELECT id , titr" . LANG . " as titre ,document , dat from contenu where titr" . LANG . " IS NOT NULL and modul=" . tg('id') . " {$wher} order by id DESC limit " . ($pagination->get_page() - 1) * $records_per_page . ', ' . $records_per_page)) { $db->Kill('Error1s'); } $pagination->records($totalrow); $pagination->records_per_page($records_per_page); ?> <div class="sidebar"> <!-- ################################################################################################ -->
<?php //addnews($titrfr,$titren,$titrar,$contfr,$conten,$contar,$img,$id,$autfr,$auten,$autar,$slider) if (tp('verif') == 1) { //verif si il y a une image. $nextid = getnextidtable('contenu'); if (tp('slider') == "1" && tp('photoid') == NULL) { exit("2#Pour afficher cette actualité dans le slider il faut insérer une photo !"); } /*if(tp('photoid')!="" ) { $slider=tp('slider'); } else{ $slider=''; }*/ model::load('news', 'addnews'); if (!addnews(tp('titrfr'), tp('titren'), tp('titrar'), tp('contfr'), tp('conten'), tp('contar'), tp('photoid'), $nextid, tp('autfr'), tp('auten'), tp('autar'), tp('slider'), tp('dat'), tp('flash'), tp('vod'), tp('phototid'))) { exit("2#Erreur système"); } else { exit("1#Opération réussie"); } } else { view::load('news', 'addnews'); }
<?php if (tp('verif') == 1) { model::load('admin', 'editcompteuser'); $iduser = tp('iduser'); if (!edituser($iduser, tp('firstname'), tp('lastname'), tp('password'), tp('username'), tp('service'), tp('agence'), tp('tel'), tp('email'))) { exit("2"); } else { exit("1"); } } else { view::load('admin', 'editcompteuser'); }
<?php if (tp('verif') == 1) { model::load('gestionvilla', 'resiliercontrat'); if (!compare_date(tp('idcontrat'), tp('date'))) { exit("3"); } else { if (!setcontrat(tp('idcontrat'), tp('date'), tp('pjid'))) { exit("2"); } else { setvilla(tp('villa')); exit("1"); } } } else { view::load('gestionvilla', 'resiliercontrat'); }
<?php if (tp('q') != '' && tg('s') == 0) { define('POST', tp('q')); header('location:././?_tsk=recherche&m=2&s=' . POST); } else { if (tg('s') !== 0) { define('POST', tg('s')); } else { exit(header('location:./')); } } if (strlen(POST) < 3) { msgbox(lg('RECHERR'), 0, './', 4); } else { view::load('page', 'recherche'); }