Exemple #1
0
         $row[$_POST['fposition']] = implode(".", $field);
         $data = implode("|", $row);
     } else {
         $data = $_POST['input'];
     }
 }
 $template->set_filenames(array('body' => 'final.html'));
 $template->assign_vars(array('HIDDEN' => $data));
 $row = explode("|", $data);
 if (sizeof($row) > 1) {
     include "classes/deposit.php";
     $test = new deposit();
     for ($j = 0; $j < sizeof($row) - 1; $j++) {
         $field = explode(".", $row[$j]);
         //==Pulls an entry and verifies that the customer is a customer in the zone
         $field[2] = $test->is_cust($field[0]);
         if (!$field[2]) {
             $template->assign_block_vars('error', array('CLIENT_ID' => $field[0], 'GOAL' => $field[1], 'POSITION' => $j));
             $template->assign_block_vars('error.switch_who_the_hell', array());
             continue;
         }
         //==Pulls an entries goal out of the db and tests to see if the deposit is round
         $field[3] = $test->is_goal_round($field[2], $field[1]);
         //==Compares each entry to look for double customers
         $field[4] = $test->is_double($field[0], $row);
         if (!$field[2] || !$field[3] || !$field[4]) {
             $template->assign_block_vars('error', array('CLIENT_ID' => $field[0], 'GOAL' => $field[1], 'POSITION' => $j));
         }
         /*if($field[2]!=1){
         			$template->assign_block_vars('error.switch_not_cust', array());
         		}*/
Exemple #2
0
        include_once "view_all_clients.php";
    } else {
        $template->set_filenames(array('body' => 'zone_error.html'));
        $template->pparse('body');
    }
} else {
    include 'classes/my_customers.php';
    $List = new client();
    if ($_GET['pageload'] == 7) {
        $template->set_filenames(array('body' => 'view_client.html'));
        if ($_GET['cid'] || $_POST['cid'] || $_POST['scid']) {
            include "classes/deposit.php";
            $test = new deposit();
            $cid = $_GET['cid'] + $_POST['cid'];
            if ($_POST['scid']) {
                $cid = $test->is_cust($_POST['scid'], $_POST['szone']);
                if ($cid == 0) {
                    $template->assign_vars(array('ERROR' => "Votre donnee n'est pas valide"));
                    $template->assign_block_vars('switch_cust_search', array());
                    if ($_SESSION['access'] > 1) {
                        $template->assign_block_vars('switch_cust_search.switch_zone', array());
                    }
                    $template->pparse('body');
                    $template->set_filenames(array('footer' => 'footer.html'));
                    $template->pparse('footer');
                    exit;
                }
            }
            $template->assign_block_vars('switch_cust_display', array());
            $List->query("CREATE TEMPORARY TABLE recent_date_zone \r\n\t\t\t\t\tSELECT MAX( DATE ) AS max_date, CUST_ID \r\n\t\t\t\t\tFROM cust_location\r\n\t\t\t\t\tWHERE CUST_ID= {$cid}\r\n\t\t\t\t\tGROUP BY CUST_ID;");
            $List->query("CREATE TEMPORARY TABLE current_zone \r\n\t\t\t\t\tSELECT cust_location.CUST_ID, cust_location.ZONE\r\n\t\t\t\t\tFROM recent_date_zone, cust_location\r\n\t\t\t\t\tWHERE cust_location.DATE = recent_date_zone.max_date\r\n\t\t\t\t\tAND cust_location.CUST_ID = recent_date_zone.CUST_ID\r\n\t\t\t\t\tAND ZONE = {$_SESSION['zone']};");