Ejemplo n.º 1
0
                              <input type="text" data-role="date" id="datepicker1" data-inline="true" name="new_date" placeholder="yyyy-mm-dd">
                              <input type="submit" name="change_date" value="Change">
                              
                          </form>
                          
                          
                          </p>
                             </div>
                           </div>
                               
                                 <div data-role="collapsible">
                         <h3>Change current site <?php 
if (isset($new_customer)) {
    echo $new_customer;
    $site_id = get_site_session_change();
    set_site_id($site_id);
    //we save in sesson
    if (isset($site_id)) {
        echo $sql = "UPDATE site SET Origin_origin_id='{$new_customer}' WHERE site_id='{$site_id}'";
        $result = query_selecti($sql);
    }
    if ($result) {
        echo " - Changed for: " . $new_date;
    }
}
?>
</h3>
                          <p>If you done mistake, and specified a wrong site. Please change a site</p>
                             
                                 <?php 
echo '<div data-role="main" class="ui-content">';
Ejemplo n.º 2
0
function generate_default_manifest_counter($SIZE_OF_MANIFEST)
{
    //instead or preset size of manifest there may be a function checking the sub_cat maybe
    global $FLAG_MANIFEST_UNQ_NUMBER;
    //to be funny we take unique manifest_number as global :) asuuming it's correctly stored somewhere :)
    //if exist of course ;P
    //**
    $result_sub_categories = read_sub_categories();
    //we ll read all no constraint
    //** dont know how many. needs to be extracted to manifest counter. leets check how many
    $number_of_subcategories_avl = mysqli_num_rows($result_sub_categories);
    //checking how many
    echo "NUMBER AVAIL: " . $number_of_subcategories_avl;
    //OK extracted 61 sub cat availible originally. assuming those the some drove on manifest. but here we
    //genereate the counter only to manifest size, the main varaiable for calculations.
    if (!empty($FLAG_MANIFEST_UNQ_NUMBER)) {
        $c = 0;
        echo "Generating counter table";
        echo "Extatracting availible categoreis: " . $number_of_subcategories_avl . " -" . $SIZE_OF_MANIFEST;
        for ($i = 0; $i < $SIZE_OF_MANIFEST; $i++) {
            $row = mysqli_fetch_row($result_sub_categories);
            //gets one and put pointer ahead
            $sub_cat = $row[0];
            //get manifest reg id
            //conversion of uniqu number for ai manifest id
            $manifest_id = read_manifest_id($FLAG_MANIFEST_UNQ_NUMBER);
            //lets do the transaction or not...
            //prepared statement instead                                                                        //QTTY set 0 ;EXTRACT sub_cat real. old mode they are orgines 1 to n
            $sql = "INSERT INTO manifest_counter(manifest_counter,sub_cat,manifest_reg_idmanifest_reg,finished) VALUES('0','{$sub_cat}',{$manifest_id},'0')";
            //state finished is 0 while manifest counter initialized. we give counter as order of items, doesnt matter, and sub_cat 0, cause nothing picked up yet.
            //we also leave space for further function for manifest_counter clonong. That comes with manifest site_has cat filling in real time. not sure of its purpose yet
            $result = query_selecti($sql);
            if ($result) {
                $c++;
            }
        }
        echo "done: " . $i . "==" . $c;
        if ($c == $i) {
            //here we put a sticker. good place
            $first_sticker = get_sticker_session();
            $sql = "UPDATE manifest_reg SET start_dbs='{$first_sticker}' WHERE manifest_unq_num='{$FLAG_MANIFEST_UNQ_NUMBER}'";
            //here w can switch as well to manifest_id
            query_selecti($sql);
            echo "Before site generatiion";
            $last_site = dbi_generate_site();
            //if initialized and generated manifest reg and counter than open a new site to write
            //here we update site manifest_counter
            set_site_id($last_site);
            // here we set session site id only if it was genereted correctly
            echo "Updating site " . $last_site;
            //site id temporary keep in session
            //$_SESSION['SITE_ID']=$last_site;
            echo $update = "UPDATE manifest_reg SET siteid='{$last_site}' WHERE idmanifest_reg='{$manifest_id}'";
            $result = query_selecti($update);
            if ($result) {
                echo "Manifest Reg site updated";
            }
        }
    } else {
        echo "Couldnt initialized manifest counter cause global FLAG_MANIFEST_REG not set, UNQ_NUM";
    }
}