本文整理汇总了PHP中tp函数的典型用法代码示例。如果您正苦于以下问题:PHP tp函数的具体用法?PHP tp怎么用?PHP tp使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了tp函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: compare_date
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;
}
}
示例2: tp
<?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");
}
}
示例3: exit
<?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');
}
示例4: DateTime
<?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');
}
示例5: tp
<?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');
}
示例6: pagination
?>
</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();
示例7: tp
<?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');
示例8: tp
//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');
}
}
}
示例9: cryptage
<?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='" . md5(tp('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');
}
示例10: tp
<?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);
}
示例11: tp
<?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');
}
示例12: tp
<?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');
示例13: tp
<?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');
示例14: tp
<?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');
示例15: ChaineAleatoire
<?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 {