Ejemplo n.º 1
0
function get_site_has_cat_weight($site_id, $sub_cat)
{
    global $site_date_collection;
    $sql = "SELECT * FROM site_has_cat WHERE Site_site_id='{$site_id}'";
    $result = query_select($sql);
    //$date="SELECT * FROM site WHERE site_id"
    while ($rek = mysql_fetch_array($result, MYSQL_BOTH)) {
        $sum_weight += $rek['Quantity'] * get_weight($rek['Sub_cat_id_c']);
        //this takes quantity stored in site_has_cat and recalculates it it takes new weight through new module of calculation
        //including standard weight and non standard
    }
    return $sum_weight;
}
		 <td align="center"><?php 
            echo $vo["goodid"];
            ?>
</td>
                <td><A href="<?php 
            echo U('Home/Article/detail?id=' . $vo['goodid']);
            ?>
" > <img src="<?php 
            echo get_cover(get_cover_id($vo["goodid"]), 'path');
            ?>
"  width="40" height="40"/><?php 
            echo get_good_name($vo["goodid"]);
            ?>
</A></td>
               <td align="center"> <span class="weight"><?php 
            echo get_weight($vo["goodid"]);
            ?>
</span>g</td>
                <td align="center"><?php 
            echo get_good_price($vo["goodid"]);
            ?>
</td>
                 <td align="center"><?php 
            echo $vo["num"];
            ?>
</td>
                
            </tr><?php 
        }
    }
} else {
Ejemplo n.º 3
0
   
 }while($insert_count<=$manifest_size);
 */
 while ($rek_mobile_subcat = mysql_fetch_array($result_mobile_subcat)) {
     echo $rek_mobile_subcat['id'];
     $sub_cat_id_c = $rek_mobile_subcat['Sub_cat_id_c'];
     $site_site_id_c = $rek_mobile_subcat['Site_site_id'];
     $quantity = $rek_mobile_subcat['Quantity'];
     $sum_weight = $rek_mobile_subcat['sum_weight'];
     $rek_mobile_subcat['id_c'];
     echo $categoryid = $rek_mobile_subcat['Category_id'];
     echo $weightid = $rek_mobile_subcat['Weight_id'];
     $name_sub = $rek_mobile_subcat['Name_sub'];
     $kind = $rek_mobile_subcat['kind'];
     $weight = array();
     $weight = get_weight($weightid);
     if (!empty($weight)) {
         echo "<BR/>Weights taken from Mobile System";
     }
     //echo $weight['id'];
     //echo $weight['weight'];
     $category = array();
     $category = get_category($categoryid);
     if (!empty($category)) {
         echo "<BR/>Category taken from Mobile System";
     }
     if (!empty($category) and !empty($weight)) {
         mysql_connect($host_in, 'root', 'krasnal');
         mysql_select_db($dbs3_in);
         echo "<BR />Category transfer. Sub_cat";
         echo "Problem with conversion module. Assigned to sub cat";
     // vyberaem chto zharitq. a zharitq mozhno lishq syroe i rybu. dazhe nevazhno chto, prosto berem vse chto nachinaetsha raw ili fish s inventarja, i raw zamenjaem na fry, a fish na fry_fish:
     include_once 'modules/f_list_inventory.php';
     $f .= '<b>выберите что приготовить:</b><br/>';
     $f .= list_inventory($LOGIN, 'i.f.foo.raw_', 'use_stand&item=' . $item . '&part=2&sa=fry');
     $f .= list_inventory($LOGIN, 'i.f.foo.fish_', 'use_stand&item=' . $item . '&part=2&sa=fry');
     $f .= '&#171;<a class="blue" href="game.php?sid=' . $sid . '&action=use_stand&item=' . $item . '">назад</a>';
     exit_msg('кострище', $f);
 } else {
     $to = mysql_real_escape_string(strip_tags($_GET['to']));
     if (substr($to, 0, 12) != 'i.f.foo.raw_' && substr($to, 0, 12) != 'i.f.foo.fish') {
         put_g_error('Жарить можно сырую рыбу и мясо. ты та что суешь?');
     }
     // v ostalqnyh sluchajah zharim
     // berem ves veshi -
     include_once 'modules/f_get_weight.php';
     $wgh = get_weight($to);
     // udaljaem syrqe
     include_once 'modules/f_delete_item.php';
     delete_item($to);
     // smotrim che eto takoe bylo -
     include_once 'modules/f_real_name.php';
     $to = real_name($to);
     // dalee, berem shans prigotovitq
     // on raven 100 - ves * 10 + navyk * 10.
     // esli ves > 30, on raven navyku prigotovlenija
     // esli navyk 0, shans 0
     $chanse = 0;
     if ($wgh < 30) {
         $chanse = 100 - $wgh * 10 + $p['skills'][37] * 10;
     } else {
         $chanse = $p['skills'][37];
Ejemplo n.º 5
0
function detect_atts($atts_mixed, $categories_num)
{
    $table_category_wth_atts = array();
    echo "Deteckting atts";
    $att_flag = array();
    $att_flag_name_att = array();
    $keep_weights_for_atts = array();
    $siz_cat = sizeof($categories_num);
    //result of weee weights calculated if zero ignore att if set show att
    //extract tuple atts-mixed
    $att_name = $atts_mixed[0];
    $att_cat = $atts_mixed[1];
    // var_dump($categories_num);
    for ($i = 0; $i < $siz_cat; $i++) {
        //if($att_cat[$i]==0)
        // echo "</BR>";
        //   echo $att_cat[$i];
        //     echo '</BR>';
        // $att_name[$i];
        if ($categories_num[$i] > 0) {
            //       echo $i." not empty: ".$categories_num[$i];
            //if weee_category weight is not empty
            //search atts ident to find proper attscat
            for ($a = 0; $a <= sizeof($att_cat); $a++) {
                //         echo $att_cat[$a];
                // $categories_num[$i];// here should be category id obteined from reall one, but lack of time
                //so depending on the set of $i
                // echo $a+1;     //this are the atts numbers
                if ($i == 3) {
                    //future field for atts assigned to particular item type
                    $sql_conotation = "SELECT id_c FROM sub_cat WHERE conotation='mobile_att'";
                    $result = query_selecti($sql_conotation);
                    $rek = mysqli_fetch_array($result);
                    if ($keep_weights_for_atts[3] = get_weight($rek[0])) {
                        if (!empty($keep_weights_for_atts[3])) {
                            $att_flag[3] = 1;
                            $att_flag_name_att[3] = "Mobile";
                        }
                    } else {
                    }
                } else {
                    if ($att_cat[$a] == $i) {
                        if ($i == 1) {
                            //omit if finds lda/ check calculations
                        } else {
                            //        echo "found att: ".$att_cat[$a];
                            //        echo " for ".$i;
                            $att_flag[$i] = 1;
                            $att_flag_name_att[$i] = $att_name[$a];
                            $keep_weights_for_atts[$i] = $categories_num[$i];
                        }
                        //from 0 search in table not in db :)
                    } else {
                        if ($att_cat[$a] == "1-10") {
                            //  echo "found special att 1-10 only one for".$i;
                            //here take calculated weee_categories and check
                            //if any weight set
                            $keep_weight = 0;
                            for ($d = 0; $d <= 10; $d++) {
                                if ($categories_num[$d] > 0) {
                                    $keep_weight += $categories_num[$d];
                                }
                                if ($keep_weight > 0) {
                                    if ($keep_weights_for_atts[3]) {
                                        //that means if set moboile weight than subside
                                        $keep_weights_for_atts[9] = $keep_weight - $keep_weights_for_atts[3];
                                    } else {
                                        $keep_weights_for_atts[9] = $keep_weight;
                                    }
                                    $att_flag[9] = 1;
                                    $att_flag_name_att[9] = "Weee";
                                }
                            }
                        }
                    }
                }
            }
        }
    }
    // end of for
    return array($att_flag, $att_flag_name_att, $keep_weights_for_atts);
    // att flag were is active and also alongside the name of att for placeholder
}
		 <td align="center"><?php 
echo $info["goodid"];
?>
</td>
                <td><A href="<?php 
echo U('Home:Article/detail?id=' . $vo['goodid']);
?>
" > <img src="<?php 
echo get_cover(get_cover_id($info["goodid"]), 'path');
?>
"  width="40" height="40"/><?php 
echo get_good_name($info["goodid"]);
?>
</A></td>
               <td align="center"> <span class="weight"><?php 
echo get_weight($info["goodid"]);
?>
</span>g</td>
                <td align="center"><?php 
echo get_good_price($info["goodid"]);
?>
</td>
                 <td align="center"><?php 
echo $info["num"];
?>
</td>
                
            </tr>
                         </tbody></table>  <BR/>  
		  <div style="color:red">
		  <p style="text-align:right;color:red;width:100%">小计:<?php 
Ejemplo n.º 7
0
      <link rel="stylesheet" href="form_cat.css " type="text/css">
        
      <style>
          td {
              text-align:center;}
          
      </style>
      
    </HEAD>
    <BODY>
      <?php 
//connect_db();
echo "<table><th>weight n-1</th><th>weight n<th></th><tr><td>";
echo get_standard_weight($id_c);
echo "</td><td>";
echo get_weight($id_c);
echo "</td><td>";
if (check_trace($id_c) == 0) {
}
echo "</td></tr></table>";
?>
        </BR></BR>
      <?php 
$date_started = date("Y-m-d");
echo "<form action='sub_cat_revise.php' method='POST'>";
echo "<input type='text' name='date_started' value='" . $date_started . "' placeholder='date_started'></BR>";
echo "<input type='text' name='weight' value='' placeholder='weight...'></BR>";
echo "<input type='text' name='cat' value='' placeholder='category..'></BR>";
echo "<input type='hidden' name='id_cat' value='" . $id_c . "' ></BR>";
echo "<input type='Submit' name='insert' value='Add token trace'>";
echo "</form>";
function insert_videos()
{
    $videos = get_videos();
    $i = 1;
    $search_query = '';
    foreach ($videos as $video) {
        if ($i > 1) {
            $search_query .= ' or';
        }
        $search_query .= " type='{$video}'";
        $i++;
    }
    $query = "select * from items where remove !=1 and ({$search_query}) order by band asc";
    $result = mysql_query($query);
    if ($result) {
        $videos = array();
        while ($video = mysql_fetch_array($result)) {
            $image = get_record_image($video);
            //get the stored filename for the image
            $band = get_band($video);
            $title = get_title($video);
            $type = str_replace('\\', '', $video['type']);
            if (isset($title) && !empty($title)) {
                $title = strtoupper($band) . ' "' . $title . '"';
            } else {
                $title = strtoupper($band);
            }
            $itemid = $video['itemid'];
            $sku = get_sku($video);
            $variant_sku = $sku . '-' . strtolower($type);
            $vendor = strip_tags($video['label']);
            $vendor = str_replace('\\', '', $vendor);
            $shopify_type = 'Video';
            $description = clean_text($video['description']);
            $weight = get_weight($type);
            $price = str_replace('$', '', $video['price']);
            if ($price == 'FREE') {
                $price = 0;
            }
            $sellprice = $price;
            $tags = "{$band}, {$type}, {$vendor}";
            $alt = null;
            if ($image) {
                $alt = $title;
            }
            $videos[] = array($variant_sku, $title, $description, $vendor, $shopify_type, $tags, 'true', "Format", $type, null, null, null, null, $variant_sku, $weight, null, 1, 'deny', 'manual', $price, null, 'true', 'true', null, $image, $alt);
        }
        return $videos;
    }
}
Ejemplo n.º 9
0
function construct_table_draw_table($sql_load)
{
    //here we get all parameters needed to set a size of manifests
    $PARAMETER = "true";
    //just something
    get_size_of_manifest($sql_load);
    //yes here only once. Lets change it
    //ok no global db cause before connect local db glob
    connect_dbi();
    //here this query should be prepered and keep as one global passed to functons. Reference add to db needs to read first counter
    //* $sql="SELECT * from sub_cat ORDER BY id_c DESC";
    $sql = $sql_load;
    $NUM_DRAW = 0;
    echo '<table data-filter="true">';
    $result = query_selecti($sql);
    $counter_grid = 0;
    echo "<tr>";
    while ($rek = mysqli_fetch_array($result, MYSQL_BOTH)) {
        //here shall be checked counter_grid and a Size_of_manifest if any discrepancies than communicate. Serious error. This means that what is visible on manifest
        //is different of that what was logicly received from manifest size function that is the main one needes for calculation
        $counter_grid++;
        $NUM_DRAW++;
        //This variable is local to draw function and is used to get ordered row in table
        $rcvd_qtty = qtty_rcvd_manifest_counter_no_delay(extract_session_manifest_reg(), $rek['id_c']);
        $sub_cat_item_name = $rek['Name_sub'];
        //this is name of subcategory.
        $placeholder_sub_cat = $sub_cat_item_name;
        $placeholder_sub_cat .= "...QTTY...";
        /*   
           if(($counter_grid%2==0))
           echo '<td>1'; 
           else if($counter_grid%2==1)
           echo '<td>2';
        * 
        */
        //was #manifest
        echo '<td>';
        echo '<form action="" id="manifest' . $NUM_DRAW . '" method="POST" data-ajax="false" data-prefetch="false">';
        //taken numeric value out
        //$rek['id_c']." ".
        echo $rek['Name_sub'] . " " . visible($rek['kind']) . " " . get_weight($rek['id_c']) . " kgs ";
        echo ' QTTY: ' . $rcvd_qtty . ' </p>';
        echo '<input type="hidden" name="num_sub_cat_un" value="' . $rek['id_c'] . '">';
        //this hidden variable is used to generate universal post sub_category number and send it
        echo '<input type="hidden" name="no-delay" value="' . $rcvd_qtty . '">';
        //temoporary to send qtty without delay
        echo '<input type="submit" value="+" name="plus' . $NUM_DRAW . '" data-role="button" data-transition="flip" data-inline="true">';
        echo '<input type="submit" value="-" name="minus' . $NUM_DRAW . '" data-role="button" data-inline="true">';
        echo '<input type="text" name="qtty' . $NUM_DRAW . '" value="" placeholder="' . $placeholder_sub_cat . '"  >';
        echo '</td>';
        if ($counter_grid % 3 == 0) {
            echo '<tr></tr>';
        }
        echo '</form>';
    }
    echo '</table>';
}