function betweenDate($dateB1, $dateB2, $date, $format = 'd/m/Y')
{
    if (compareDate($date, $dateB1) != -1 && compareDate($date, $dateB2) != 1) {
        return true;
    }
    return false;
}
示例#2
0
function CFquStatusText($start, $limit)
{
    switch (compareDate($start, $limit)) {
        case 0:
            // 回答受付中
            return '回答受付中';
        case 1:
            // 回答終了
            return '回答終了';
        case 2:
            // 回答開始前
            return '回答開始前';
    }
}
        echo "<td bgcolor=white>" . $l[4] . "</td>";
        echo "<td bgcolor=white>" . $l[5] . "</td>";
        echo "<td bgcolor=white>" . $l[3] . "</td>";
        $Expresion = "TR_P_" . $l[0];
        $cont = ListarPrestamo($Expresion);
        $cont = implode("", $cont);
        if (substr($cont, 0, 8) != '$$TOTAL:') {
            $cont = explode('###', $cont);
            $c = explode('$$$', $cont[0]);
            echo "<td bgcolor=white>" . $c[0] . "</td><td bgcolor=white>" . PrepararFecha($c[1]) . "</td>";
        } else {
            echo "<td bgcolor=white>&nbsp;</td><td bgcolor=white>&nbsp;</td>";
        }
    }
}
function EjemplaresPrestados($inventory)
{
    global $db_path, $Wxis, $xWxis;
    $formato_obj = $db_path . "trans/pfts/" . $_SESSION["lang"] . "/loans_display.pft";
    if (!file_exists($formato_obj)) {
        $formato_obj = $db_path . "trans/pfts/" . $lang_db . "/loans_display.pft";
    }
    $query = "&Expresion=TR_P_" . $inventory . "&base=trans&cipar={$db_path}" . "par/trans.par&Formato=" . $formato_obj;
    $IsisScript = $xWxis . "cipres_usuario.xis";
    include "../common/wxis_llamar.php";
    $prestamos = array();
    foreach ($contenido as $linea) {
        $prestamos[] = $linea;
    }
    $nv = 0;
    //número de préstamos vencidos
    $np = 0;
    //Total libros en poder del usuario
    if (count($prestamos) > 0) {
        foreach ($prestamos as $linea) {
            $p = explode("^", $linea);
            $np = $np + 1;
            $dif = compareDate($p[9]);
            $fuente = "";
示例#4
0
function validateTourdates($form)
{
    global $db;
    if (checkEmpty($form['venue_name'])) {
        $msg = str_replace('field', _VENUE, _ALRT_REQUIRED_FIELD);
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    if (checkEmpty($form['tour_city'])) {
        $msg = str_replace('field', _CITY, _ALRT_REQUIRED_FIELD);
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    if (checkEmpty($form['tour_state'])) {
        $msg = str_replace('field', _LBL_STATE, _ALRT_REQUIRED_FIELD);
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    if (checkEmpty($form['tour_country'])) {
        $msg = str_replace('field', _LBL_COUNTRY, _ALRT_REQUIRED_FIELD);
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    if (checkEmpty($form['tourdate'])) {
        $msg = str_replace('field', _LBL_START_DATE, _ALRT_REQUIRED_FIELD);
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    if (checkEmpty($form['tourdate'])) {
        $msg = _ALRT_SEL_STARTDATE;
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    } else {
        $showdate = validateDate($form['tourdate']);
        if ($showdate !== true) {
            $msg = $showdate . ' ' . _LBL_FOR . ' ' . _LBL_START_DATE;
            $show_tab_type = 'TOURDATES_INFO';
            return $msg;
        }
        if (compareDate($form['tourdate'], date('m/d/Y'), 1)) {
            $msg = _ALRT_VALID_TOURDATE;
            $show_tab_type = 'TOURDATES_INFO';
            return $msg;
        }
    }
    $date = getYearMonthDateSearch($form['tourdate'], "/", "-");
    if (isset($form['tourdate_id'])) {
        $sql = 'SELECT AF_TOURDATE_ID FROM xebura_TOURDATE 
			WHERE AF_TOURDATE_ARTIST_ID = \'' . $_SESSION['User_Account_Id'] . '\'
			AND (AF_TOURDATE_VENUE_ID = \'' . $form['venue'] . '\' 
			OR (AF_TOURDATE_VENUE_NAME = \'' . $form['venue_name'] . '\'
			AND AF_TOURDATE_VENUE_CITY = \'' . $form['tour_city'] . '\'
			AND AF_TOURDATE_VENUE_STATE = \'' . $form['tour_state'] . '\'
			AND AF_TOURDATE_VENUE_COUNTRY = \'' . $form['tour_country'] . '\'))
			AND AF_TOURDATE_STARTDATE = \'' . $date . '\'
			AND AF_ARTIST_DISCOG_ID != \'' . $form['tourdate_id'] . '\'';
    } else {
        $sql = 'SELECT AF_TOURDATE_ID FROM xebura_TOURDATE 
			WHERE AF_TOURDATE_ARTIST_ID = \'' . $_SESSION['User_Account_Id'] . '\'
			AND (AF_TOURDATE_VENUE_ID = \'' . $form['venue'] . '\' 
			OR (AF_TOURDATE_VENUE_NAME = \'' . $form['venue_name'] . '\'
			AND AF_TOURDATE_VENUE_CITY = \'' . $form['tour_city'] . '\'
			AND AF_TOURDATE_VENUE_STATE = \'' . $form['tour_state'] . '\'
			AND AF_TOURDATE_VENUE_COUNTRY = \'' . $form['tour_country'] . '\'))
			AND AF_TOURDATE_STARTDATE = \'' . $date . '\'';
    }
    if ($db->query_affected_rows($sql) > 0) {
        $msg = _CHECK_DUPLICATE_TOURDATE;
        $show_tab_type = 'TOURDATES_INFO';
        return $msg;
    }
    return true;
}
示例#5
0
            $Formato = $db_path . "trans/pfts/" . $_SESSION["lang"] . "/" . $pr_return;
        } else {
            if (file_exists($db_path . "trans/pfts/" . $lang_db . "/" . $pr_return . ".pft")) {
                $Formato = $db_path . "trans/pfts/" . $lang_db . "/" . $pr_return;
            }
        }
        if ($Formato != "") {
            $Formato = "&Formato={$Formato}";
        }
    }
    $query = "&base=trans&cipar={$db_path}" . "par/trans.par&login="******"login"] . "&Mfn=" . $Mfn . "&ValorCapturado=" . $ValorCapturado . $Formato;
    include "../common/wxis_llamar.php";
    $recibo = implode(" ", $contenido);
}
// si está atrasado se procesan las multas y suspensiones
$atraso = compareDate($fecha_d);
if ($politica == "") {
    $error = "&error=" . $msgstr["nopolicy"] . " {$tipo_usuario} / {$tipo_objeto}";
} else {
    $error = "";
    if ($atraso < 0) {
        $atraso = abs($atraso);
        Sanciones($fecha_d, $atraso, $arrHttp["usuario"], $inventario, $ppres);
    }
}
$cu = "";
if (isset($arrHttp["usuario"])) {
    $cu = "&usuario=" . $arrHttp["usuario"];
} else {
    $cu = "&usuario={$cod_usuario}";
}
示例#6
0
function addAct($bdd, $idco, $nom)
{
    /* On récupère son member_ID */
    $memberID = getMemberID($bdd, $idco);
    /* On récupère son basket_ID */
    $basketID = getBasketID($bdd, $memberID);
    /* On récupère le prix, le type et l'activity_ID de l'activité choisie */
    list($a1, $m1, $j1, $heure1, $min1, $sec1) = dateAuj($bdd);
    $a2 = 2016;
    $j2 = 31;
    $m2 = 3;
    /* Comparaison des dates */
    $privilege = compareDate($j1, $m1, $a1, $j2, $m2, $a2);
    /* Si on est avant le 31 mars, le tarif sera le premier */
    if ($privilege == 1) {
        $sql3 = 'SELECT Activity_ID, Activity_Price1, Activity_Type_Name FROM Activity ' . 'INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . 'WHERE (Congress_ID =' . congressID . ' AND Activity_Name = :nom )';
        $stmt = $bdd->prepare($sql3, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array('nom' => "{$nom}"));
        $row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
        $prix = $row["Activity_Price1"];
        $activiteID = $row["Activity_ID"];
        $type = $row["Activity_Type_Name"];
    } else {
        /* Si on est après le 31 mars, le tarif sera le second */
        $sql3 = 'SELECT Activity_ID, Activity_Price2, Activity_Type_Name FROM Activity ' . 'INNER JOIN Activity_Type ON (Activity_Type.Activity_Type_ID = Activity.Activity_Type_ID) ' . 'WHERE (Congress_ID =' . congressID . '  AND Activity_Name = :nom )';
        $stmt = $bdd->prepare($sql3, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array('nom' => "{$nom}"));
        $row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
        $prix = $row["Activity_Price2"];
        $activiteID = $row["Activity_ID"];
        $type = $row["Activity_Type_Name"];
    }
    /* On ajoute à la table belong le basket_ID, l'activity_ID et le prix */
    insertBelong($bdd, $activiteID, $basketID, $prix);
    /* On met à jour le panier en calculant les totaux */
    /* On commence par récupérer les totaux qui nous interessent */
    if (strcmp($type, "Repas") == 0) {
        $sql5 = 'SELECT Basket_Meal_Total, Basket_Total FROM Basket ' . ' WHERE (Basket_ID = :id )';
        $stmt = $bdd->prepare($sql5, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array('id' => "{$basketID}"));
        $row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
        $total = $row["Basket_Total"];
        $soustotal = $row["Basket_Meal_Total"];
    } else {
        $sql5 = 'SELECT Basket_Trip_Total, Basket_Total FROM Basket' . ' WHERE (Basket_ID = :id )';
        $stmt = $bdd->prepare($sql5, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
        $stmt->execute(array('id' => "{$basketID}"));
        $row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
        $soustotal = $row["Basket_Trip_Total"];
        $total = $row["Basket_Total"];
    }
    /* On met à jour le panier */
    $total2 = "{$total}" + "{$prix}";
    $soustotal2 = "{$soustotal}" + "{$prix}";
    if (strcmp($type, "Repas") == 0) {
        $sql6 = 'UPDATE Basket SET Basket_Meal_Total = :soustotal WHERE (Basket_ID = :id)';
        $stmt = $bdd->prepare($sql6);
        $stmt->execute(array('soustotal' => "{$soustotal2}", 'id' => "{$basketID}"));
    } else {
        $sql6 = 'UPDATE Basket SET Basket_Trip_Total = :soustotal WHERE (Basket_ID = :id)';
        $stmt = $bdd->prepare($sql6);
        $stmt->execute(array('soustotal' => "{$soustotal2}", 'id' => "{$basketID}"));
    }
    $sql6 = 'UPDATE Basket SET Basket_Total = :total WHERE (Basket_ID = :id)';
    $stmt = $bdd->prepare($sql6);
    $stmt->execute(array('total' => "{$total2}", 'id' => "{$basketID}"));
    /* On décrémente le nombre de places de l'activité */
    $sql7 = 'SELECT Activity_Capacity  FROM Activity  WHERE (Activity_ID = :id)';
    $stmt = $bdd->prepare($sql7, array(PDO::ATTR_CURSOR, PDO::CURSOR_SCROLL));
    $stmt->execute(array('id' => "{$activiteID}"));
    $row = $stmt->fetch(PDO::FETCH_ASSOC, PDO::FETCH_ORI_NEXT);
    $cap = $row["Activity_Capacity"];
    $cpt = nbPersonne($bdd, $memberID);
    $sum = "{$cap}" - "{$cpt}";
    $sql8 = 'UPDATE Activity SET Activity_Capacity = :sum WHERE (Activity_ID=:id)';
    $stmt = $bdd->prepare($sql8);
    $stmt->execute(array('sum' => "{$sum}", 'id' => "{$activiteID}"));
    header("location:" . $_SERVER['HTTP_REFERER']);
}
    echo "alert('Date de début vide! Veuillez remplir le champ prévu.');";
    //echo "return false;";
    exit;
}
if (dateValid($date_debut_bareme) == 0) {
    echo "alert('Date de début invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_echeance_bareme != '' && $date_echeance_bareme != "00-00-0000" && $date_echeance_bareme != "0000-00-00") {
    if (dateValid($date_echeance_bareme) == 0) {
        echo "alert('Date d\\'échéance invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_debut_bareme, $date_echeance_bareme) == 0) {
        echo "alert('La date d\\'échéance est plus petite que la date de début! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($id_bareme == 0) {
    echo "alert('Vous n\\'avez sélectionné aucun barème! Veuillez sélectionner un barème pour l\\'agent en cours.');";
    //echo "return false;";
    exit;
}
if ($id_grade == 0) {
    echo "alert('Vous n\\'avez sélectionné aucun grade! Veuillez sélectionner un grade pour l\\'agent en cours.');";
    //echo "return false;";
    exit;
}
    echo "alert('La date de début est dépassée! Veuillez choisir une date plus récente.');";
    //echo "return false;";
    exit;
}
if (dateValid($date_debut_service) == 0) {
    echo "alert('Date de début invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_echeance_service != '' && $date_echeance_service != "00-00-0000" && $date_echeance_service != "0000-00-00") {
    if (dateValid($date_echeance_service) == 0) {
        echo "alert('Date d\\'échéance invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_debut_service, $date_echeance_service) == 0) {
        echo "alert('La date d\\'échéance est plus petite que la date de début! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
/*if($art_budgetaire=='')
{
	echo "alert('Article budgétaire vide! Veuillez remplir le champ prévu.');";
	//echo "return false;";
	exit;
}*/
if ($id_article_budgetaire == '' || $id_article_budgetaire == 0 || $id_article_budgetaire == null) {
    echo "alert('Article budgétaire vide! Veuillez remplir le champ prévu.');";
    //echo "return false;";
    exit;
    echo "alert('Date de début vide! Veuillez remplir le champ prévu.');";
    //echo "return false;";
    exit;
}
if (dateValid($date_debut_fonction) == 0) {
    echo "alert('Date de début invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_echeance_fonction != '' && $date_echeance_fonction != "00-00-0000" && $date_echeance_fonction != "0000-00-00") {
    if (dateValid($date_echeance_fonction) == 0) {
        echo "alert('Date d\\'échéance invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_debut_fonction, $date_echeance_fonction) == 0) {
        echo "alert('La date d\\'échéance est plus petite que la date de début! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($id_fonc == 0) {
    echo "alert('Vous n\\'avez sélectionné aucune fonction! Veuillez sélectionner une fonction pour l\\'agent en cours.');";
    //echo "return false;";
    exit;
}
//include('params.php');
/***Si on encode une nouvelle fonction dans le formulaire SERVICE/FCT*****/
if ($autre_type_fonc != '') {
    //$autre_type_fonc='test';
    include '../connect_db.php';
示例#10
0
if ($date_octroi == '' || $date_octroi == "00-00-0000" || $date_octroi == "0000-00-00") {
    echo "alert('Date d\\'octroi de la prime vide! Veuillez remplir le champ prévu.');";
    exit;
}
if (dateValid($date_octroi) == 0) {
    echo "alert('Date d\\'octroi invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_cloture != '' && $date_cloture != "00-00-0000" && $date_cloture != "0000-00-00") {
    if (dateValid($date_cloture) == 0) {
        echo "alert('Date de clôture invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_octroi, $date_cloture) == 0) {
        echo "alert('La date de clôture est plus petite que la date d\\'octroi! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
/* if($id_bareme==0)
{
	echo "alert('Vous n\'avez sélectionné aucun barème! Veuillez sélectionner un barème pour l\'agent en cours.');";
	//echo "return false;";
	exit;
}

if($id_grade==0)
{
	echo "alert('Vous n\'avez sélectionné aucun grade! Veuillez sélectionner un grade pour l\'agent en cours.');";
    echo "alert('Date de début vide! Veuillez remplir le champ prévu.');";
    //echo "return false;";
    exit;
}
if (dateValid($date_debut_statut) == 0) {
    echo "alert('Date de début invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_echeance_statut != '' && $date_echeance_statut != "00-00-0000" && $date_echeance_statut != "0000-00-00") {
    if (dateValid($date_echeance_statut) == 0) {
        echo "alert('Date d\\'échéance invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_debut_statut, $date_echeance_statut) == 0) {
        echo "alert('La date d\\'échéance est plus petite que la date de début! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($id_statut == 0 && $id_statut_special == 0) {
    echo "alert('Vous n\\'avez sélectionné aucun statut! Veuillez sélectionner au moins un statut pour l\\'agent en cours.');";
    //echo "return false;";
    exit;
}
include '../connect_db.php';
$sql = "\n\t\t\tinsert into cpas_mouvements_statuts \n\t\t\t(id_mvt_statut\n\t\t\t,id_agent\n\t\t\t,id_contrat\n\t\t\t,id_statut\n\t\t\t,id_statut_special\n\t\t\t,contractuel_nomme\n\t\t\t,date_debut_statut\n\t\t\t,date_echeance_statut\n\t\t\t,actif\n\t\t\t,creation_date\n\t\t\t,creation_user)\n\t\t\tvalues\n\t\t\t(''\n\t\t\t,'" . $id_agent . "'\n\t\t\t,'" . $id_contrat . "'\n\t\t\t,'" . $id_statut . "'\n\t\t\t,'" . $id_statut_special . "'\n\t\t\t,'" . $contractuel_nomme . "'\n\t\t\t,'" . transformDate($date_debut_statut) . "'\n\t\t\t,'" . transformDate($date_echeance_statut) . "'\n\t\t\t,'" . $actif . "'\n\t\t\t,NOW()\n\t\t\t,'" . $session_username . "'\n\t\t\t);\n\t";
//var_dump($sql);
$result = mysqli_query($lien, $sql);
if (!$result) {
include $rootpath . '\\organigramme\\PHPExcel_1.8.0_doc\\Classes\\PHPExcel.php';
include $rootpath . '\\organigramme\\PHPExcel_1.8.0_doc\\Classes\\PHPExcel\\Writer\\Excel2007.php';
echo "<javascript>";
include 'verification.php';
include 'params.php';
if ($date_debut == '') {
    echo "alert('Date de début vide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_fin == '') {
    echo "alert('Date de fin vide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if (compareDate($date_debut, $date_fin) == 0) {
    echo "alert('Attention la date de début est plus grande que la date de fin. Veuillez recommencer svp.');";
    exit;
}
/*******************/
function fn_ResultToArray($result = null, $id_key_unic = null)
{
    //verifier validité de $result
    if ($result == null) {
        echo "pas de parametre result";
        return false;
    }
    $tableau = array();
    while ($datas = mysqli_fetch_assoc($result)) {
        if ($id_key_unic == null) {
            $tableau[] = $datas;
示例#13
0
     $reservas[] = $linea;
 }
 $total_atraso = 0;
 $reservas_vencidas = "";
 $dias_atraso = 0;
 $fecha_inicio = "";
 $lista_reservas = array();
 $reserva_output = "";
 $reserva_novencidas = "";
 if (count($reservas) > 0) {
     $reserva_output = "<strong>" . $msgstr["reserves"] . "</strong>\r\n\t\t\t<table bgcolor=#cccccc>\r\n\t\t\t<th>" . "título" . "</th><th>" . $msgstr["reserve_date"] . "</th><th>" . $msgstr["reserve_expire"] . "</th><th></th>";
     foreach ($reservas as $res) {
         $r = explode('|', $res);
         $fecha = $r[1];
         $vence = $r[2];
         $difference = compareDate($r[2]);
         $datediff = floor($difference / 86400);
         //SE DETERMINA LA FECHA DE VENCIMIENTO MAS RECIENTE PARA
         //CALCULAR LA SUSPENSIÓN A PARTIR DE ELLS
         $anular = "";
         if ($datediff > 0) {
             $reservas_vencidas = "S";
             $total_atraso += 1;
             $vence = "<font color=red>" . $r[2] . "</font>";
             $anular = "&nbsp;";
         } else {
             if ($arrHttp["vienede"] == "ecta_web") {
                 $anular = "<a href=javascript:AnularReserva(" . $r[3] . ")>" . $msgstr["reserve_discard"] . "</a>";
             }
         }
         $reserva_output .= "<tr><td bgcolor=#FFFFFF>" . $r[0] . "</td><td bgcolor=#FFFFFF align=center>" . $fecha . "</td><td bgcolor=white align=center>{$vence}</td><td bgcolor=#FFFFFF>{$anular}</td>";
示例#14
0
 $sumLesson = 0;
 $sumAmount = 0;
 $sumBoughtLesson = 0;
 $sumBoughtAmount = 0;
 //                    echo PHPExcel_Cell::stringFromColumnIndex($colN-2).'</br>';
 while ($row2 = $result2->fetch_array(MYSQLI_NUM)) {
     if ($row2['0'] == $row['6'] && $row2['4'] == $row['10']) {
         /*                                if(array_key_exists($row2['5'], $arrX)){
                                             $objPHPExcel->getActiveSheet()->SetCellValue($arrX[$row2['3'].'_'.$row2['2']].$rowCount,$row2['1']);
                                             $objPHPExcel->getActiveSheet()->SetCellValue($arrX[$row2['3'].'_'.$row2['2'].'_2'].$rowCount,($row['9']*$row2['1']));
                                         }*/
         $objPHPExcel->getActiveSheet()->SetCellValue($arrX[$row2['5']] . $rowCount, $row2['1']);
         $objPHPExcel->getActiveSheet()->SetCellValue($arrX[$row2['5'] . '_2'] . $rowCount, $row['9'] * $row2['1']);
         //Error if $row2['3'].'_'.$row2['2'] (3_2016 on data)
         //maybe fix with (now date > db_date)
         $isNowDate = compareDate($row2['5'], $dateX);
         if ($isNowDate == -1) {
             $sumBoughtLesson += $row2['1'];
             $sumBoughtAmount += $row['9'] * $row2['1'];
             $objPHPExcel->getActiveSheet()->SetCellValue('N' . $rowCount, $sumBoughtLesson);
             $objPHPExcel->getActiveSheet()->SetCellValue('O' . $rowCount, $sumBoughtAmount);
             //                                $objPHPExcel->getActiveSheet()->getStyle('A'.$rowCount)->applyFromArray($styleArray);
         } else {
             if ($isNowDate == 0) {
                 $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($colN - 2, $rowCount, $row2['1']);
                 $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($colN - 1, $rowCount, $row['9'] * $row2['1']);
                 //                                $objPHPExcel->getActiveSheet()->getStyle('A'.$rowCount)->applyFromArray($styleArray);
             } else {
                 if ($isNowDate == 1) {
                     $sumLesson += $row2['1'];
                     $sumAmount += $row['9'] * $row2['1'];
function ProcesarReserva($usuario, $copias, $control_number)
{
    global $db_path, $Wxis, $xWxis, $arrHttp, $reservas_pendientes, $lang_db;
    //SE DETERMINA SI SE HAN IMPLEMENTADO LAS RESERVAS
    //DETERMINAR SI EL TITULO TIENE RESERVAS BUSCANDO EN RESERVE EL NÚMERO DE CONTROL
    $control_number = 3;
    $formato_obj = $db_path . "reserve/pfts/" . $_SESSION["lang"] . "/opac_reserve.pft";
    if (!file_exists($formato_obj)) {
        $formato_obj = $db_path . "reserve/pfts/" . $lang_db . "/opac_reserve.pft";
    }
    $query = "&Expresion=CN_" . $control_number . "&base=reserve&cipar={$db_path}" . "par/reserve.par&Formato={$formato_obj}";
    $IsisScript = $xWxis . "cipres_usuario.xis";
    include "../common/wxis_llamar.php";
    $total_reservas = 0;
    $mismo_usuario = "";
    $reservas_pendientes = array();
    foreach ($contenido as $linea) {
        //SE DETERMINA SI LA RESERVA ESTA VENCIDA
        $r = explode('|', $linea);
        $fecha = $r[1];
        $vence = $r[2];
        $difference = compareDate($r[2]);
        $datediff = floor($difference / 86400);
        if ($datediff >= 0) {
            $total_reservas = $total_reservas + 1;
            $reservas_pendientes[] = $linea;
        }
        //SE DETERMINA SI EL USUARIO QUE SOLICITA LO TIENE RESERVADO
        //EN CASO AFIRMATIVO SE CANCELA LA RESERVA
        if ($usuario == trim($r[4])) {
            $query = "&base=reserve&cipar={$db_path}" . "par/reserve.par&login=abcd&Mfn=" . $r[3] . "&Opcion=eliminar";
            $IsisScript = $xWxis . "eliminarregistro.xis";
            //include("../common/wxis_llamar.php");
            //SI LA RESERVA EXPIRÓ SE SUSPENDE AL USUARIO
            if ($datediff < 0) {
                echo "expiro";
            }
            return 0;
        }
    }
    //SI NO HAY RESERVAS SE PROCEDE AL PRESTAMO
    if ($total_reservas == 0) {
        return 0;
    }
    if ($total_reservas > count($copias)) {
        return $total_reservas;
    }
    //SE DETERMINA SI QUEDAN EJEMPLARES DISPONIBLES NO RESERVADOS
    //PARA ELLO SE DETERMINA EL TOTAL DE EJEMPLARES PRESTADOS PARA RESTARLE LOS RESERVADOS
    $formato_obj = $db_path . "trans/pfts/" . $_SESSION["lang"] . "/loans_display.pft";
    if (!file_exists($formato_obj)) {
        $formato_obj = $db_path . "trans/pfts/" . $lang_db . "/loans_display.pft";
    }
    $query = "&Expresion=ON_P_" . $control_number . "&base=trans&cipar={$db_path}" . "par/trans.par&Formato=" . $formato_obj;
    $IsisScript = $xWxis . "cipres_usuario.xis";
    include "../common/wxis_llamar.php";
    $total_prestados = 0;
    foreach ($contenido as $linea) {
        $total_prestados = $total_prestados + 1;
    }
    if (count($copias) > $total_prestados - $total_reservas) {
        return 0;
    } else {
        return $total_reservas;
    }
}
if ($start_date != '00-00-0000' && $start_date != '0000-00-00' && $start_date != '') {
    if (dateValid($start_date) == 0) {
        echo "alert('Date de début de contrat invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($end_date != '00-00-0000' && $end_date != '0000-00-00' && $end_date != '') {
    if (dateValid($end_date) == 0) {
        echo "alert('Date de fin de contrat invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($end_date != '00-00-0000' && $end_date != '0000-00-00' && $end_date != '') {
    if (compareDate($start_date, $end_date) == 0) {
        echo "alert('Attention la date de début de contrat est plus grande. Veuillez recommencer svp.');";
        exit;
    }
}
/**********Vérifier si le contrat est actif ou non*****************************************************/
if (transformDate($start_date) > date('Y-m-d') || transformDate($end_date) < date('Y-m-d') && $end_date != "00-00-0000" && $end_date != '' && $end_date != null) {
    $actif = 0;
} else {
    $actif = 1;
}
//$champs_signaletiques='';
/*MAJ de la table signaletique avec les champs à modifier*/
include '../connect_db.php';
$sql = "\n\t\tupdate cpas_contrats\n\t\tset \n\t\tstart_date='" . transformDate($start_date) . "',end_date='" . transformDate($end_date) . "'\n\t\t,motif_sortie='" . addslashes($motif_sortie) . "',actif=" . $actif . ",modif_date=NOW(),modif_user='******'\n\t\twhere id_contrat='" . $id_contrat . "';\n";
//var_dump( $sql);
示例#17
0
 $salida_prestamos = "<table border=0 width=100%><tr><td colspan=2><br>";
 if (!isset($arrHttp["libro"])) {
     $salida_prestamos .= "<dd><a href=javascript:Procesar('devolver') class=td5a>Devolver</a> &nbsp; &nbsp;\r\n\t\t\t\t<a href=javascript:Procesar('renovar') class=td5a>Renovar</a>";
 }
 $salida_prestamos .= "\t<dd><font class=td>Préstamos pendientes:</font></dd><dd><table width=95% bgcolor=#cccccc class=td> ";
 $salida_prestamos .= "<td> </td><td>Centro</td><td>Ejemplar</td><td>Signatura</td><td>Título</td><td>T.pre</td><td>F.prestamo</td><td>F.Devoluc.</td>";
 $np = -1;
 //número de préstamos
 $nv = 0;
 //número de préstamos vencidos
 foreach ($prestamos as $linea) {
     $p = explode("\\^", $linea);
     $np++;
     $p[4] = Iso2Fecha($p[4]);
     $p[5] = Iso2Fecha($p[5]);
     $dif = compareDate($p[5]);
     //		echo $dif;
     $fuente = "";
     if ($dif < 0) {
         $nv++;
         //cuenta de préstamos vencidos
         $fuente = "<font color=red>";
     }
     //		v800^c,'^',v800^q,'^',v800^n," Ej."v800^l,'^',v800^t,'^',v800^p,'^',v800^h,'^',v800^o,'^',f(mfn,1,0),/
     echo "<script>\r\n\t\t\t\t\tppu[{$np}]=new Array()\r\n\t\t\t\t\tppu[{$np}][0]={$p['7']}         //mfn\r\n\t\t\t\t\tppu[{$np}][1]=\"{$p['1']}\"     //Centro\r\n\t\t\t\t\tppu[{$np}][2]=\"{$p['2']}\"    //No. inventario\r\n\t\t\t\t\tppu[{$np}][3]=\"{$p['0']}\"    //cota\r\n\t\t\t\t\tppu[{$np}][4]=\"{$p['3']}\"    //descripcion\r\n\t\t\t\t\tppu[{$np}][5]=\"{$p['6']}\"    //tipo de material\r\n\t\t\t\t\tppu[{$np}][6]=\"{$p['4']}\"    //Fecha de préstamo\r\n\t\t\t\t\tppu[{$np}][7]=\"{$p['5']}\"    //Fecha de devolución\r\n\t\t\t\t\tppu[{$np}][8]=0         //dias que faltan para el vencimiento\r\n\t\t\t\t   </script>\n";
     $salida_prestamos .= "<tr><td  bgcolor=white>";
     if (!isset($arrHttp["libro"])) {
         //and $p[1]==$_SESSION["centro"]
         $salida_prestamos .= "<input type=checkbox name=chkPr value={$np}>";
     } else {
         $salida_prestamos .= "&nbsp;";
示例#18
0
     } else {
         echo "Danh sách bài báo sau thông báo 2 ngày(4 ngày kể từ ngày gửi) mà chưa được xử lý.<br>";
         echo "<table width=100% align='center'>\r\n" . "<tr>\r\n" . "<th>Tiêu đề</th>\r\n" . "<th>Người yêu cầu</th>\r\n" . "<th>Người cung cấp</th>\r\n" . "<th>Số ngày chờ</th>\r\n" . "</tr>";
         $strTrClass = "odd";
         while ($arrList_request = mysql_fetch_array($result)) {
             if (compareDate($today, $arrList_request['date_request']) >= 35) {
                 echo "<tr class=\"{$strTrClass}\">\r\n" . "\t<td>" . $arrList_request['title'] . "</td>\r\n" . "\t<td>" . $arrList_request['requester'] . "</td>\r\n" . "\t<td>" . $arrList_request['supplier'] . "</td>\r\n" . "\t<td>" . compareDate($today, $arrList_request['date_request']) . "</td>\r\n" . "</tr>\r\n";
                 $strTrClass = str_replace($strTrClass, "", 'oddeven');
             }
         }
         echo "</table>\r\n<br>";
         echo "<br>&nbsp;Danh sách thành viên trễ xử lý bài báo sau thông báo 2 ngày(4 ngày kể từ ngày gửi).<br>";
         echo "<table width=100% align='center'>\r\n" . "<tr>\r\n" . "<th>User Name</th>\r\n" . "<th>Yêu cầu đã xử lý</th>\r\n" . "<th>Yêu cầu đang chờ</th>\r\n" . "<th>Stop supplier</th>\r\n" . "</tr>";
         $strTrClass = "odd";
         while ($arrList_request_user = mysql_fetch_array($result_user)) {
             if (compareDate($today, $arrList_request_user['date_request']) >= 35) {
                 $str_select_user = "******" . $arrList_request_user['supplier'] . "'";
                 $result_user_list = mysql_query($str_select_user) or die(mysql_error());
                 while ($arrList_user = mysql_fetch_array($result_user_list)) {
                     echo "<tr class=\"{$strTrClass}\">\r\n" . "\t<td>" . $arrList_user['username'] . "</td>\r\n" . "\t<td>" . $arrList_user['request_handle_number'] . "</td>\r\n" . "\t<td>" . $arrList_user['request_pending_number'] . "</td>\r\n" . "\t<td>" . "<form name=\"frm" . $arrList_user['ID'] . "\" method=\"POST\" action=\"admin.php?action=stop_supplier\">" . "<input type=\"hidden\" name=\"txtId\" value=\"" . $arrList_user['ID'] . "\"/>" . "<input type=\"submit\" name=\"btnStop\" value=\" Stop \"/>" . "</form>" . "</td>\r\n" . "</tr>\r\n";
                     $strTrClass = str_replace($strTrClass, "", 'oddeven');
                 }
             }
         }
         echo "</table>\r\n";
     }
 } elseif ($_GET['action'] == "all_notsupplier") {
     $strMysqlQuery = "SELECT * FROM {$strTableUserName} WHERE supplier=0 and field='" . $arrUserData['field'] . "'";
     $result = mysql_query($strMysqlQuery) or die(mysql_error());
     echo "Tổng số thành viên không cung cấp: " . ($num_row = mysql_num_rows($result));
     echo "<table align='center'>\r\n" . "<tr>\r\n" . "<th>Bí danh</th>\r\n" . "<th>Chuyên ngành</th>\r\n" . "<th>Yêu cầu đã hoàn tất</th>\r\n" . "<th>Yêu cầu đang chờ</th>\r\n" . "<th>Email</th>\r\n" . "<th>Stop cung cấp</th>\r\n" . "</tr>";
    echo "alert('Date de début vide! Veuillez remplir le champ prévu.');";
    //echo "return false;";
    exit;
}
if (dateValid($date_debut_regime) == 0) {
    echo "alert('Date de début invalide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_echeance_regime != '' && $date_echeance_regime != "00-00-0000" && $date_echeance_regime != "0000-00-00") {
    if (dateValid($date_echeance_regime) == 0) {
        echo "alert('Date d\\'échéance invalide! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
    if (compareDate($date_debut_regime, $date_echeance_regime) == 0) {
        echo "alert('La date d\\'échéance est plus petite que la date de début! Veuillez recommencer.');";
        //echo "return false;";
        exit;
    }
}
if ($id_regime == 0) {
    echo "alert('Vous n\\'avez sélectionné aucun régime! Veuillez sélectionner un régime pour l\\'agent en cours.');";
    //echo "return false;";
    exit;
}
/* if($id_equiv_tp==0)
{
	echo "alert('Equivalence temps plein vide! Veuillez recommencer.');";
	//echo "return false;";
	exit;
include $rootpath . '\\organigramme\\PHPExcel_1.8.0_doc\\Classes\\PHPExcel.php';
include $rootpath . '\\organigramme\\PHPExcel_1.8.0_doc\\Classes\\PHPExcel\\Writer\\Excel2007.php';
echo "<javascript>";
include 'verification.php';
include 'params.php';
if ($date_debut_out == '') {
    echo "alert('Date de début vide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if ($date_fin_out == '') {
    echo "alert('Date de fin vide! Veuillez recommencer.');";
    //echo "return false;";
    exit;
}
if (compareDate($date_debut_out, $date_fin_out) == 0) {
    echo "alert('Attention la date de début est plus grande que la date de fin. Veuillez recommencer svp.');";
    exit;
}
/*******************/
function fn_ResultToArray($result = null, $id_key_unic = null)
{
    //verifier validité de $result
    if ($result == null) {
        echo "pas de parametre result";
        return false;
    }
    $tableau = array();
    while ($datas = mysqli_fetch_assoc($result)) {
        if ($id_key_unic == null) {
            $tableau[] = $datas;