* database username
 */
define("user", "root");
//define ("user", "root");
/**
 * database password
 */
define("pass", "");
//define ("pass", "");
/**
 * database name
 */
define("db", "mebli");
//define ("db", "mebli");
function get_product_list()
{
    $db_connect = mysqli_connect(host, user, pass, db);
    $query = "SELECT goods_article, goods_name FROM goods WHERE factory_id=34";
    if ($res = mysqli_query($db_connect, $query)) {
        while ($row = mysqli_fetch_assoc($res)) {
            $arr[] = $row;
        }
        $len = count($arr);
        for ($i = 0; $i < $len; $i++) {
            $str = $arr[$i]['goods_article'] . ", " . $arr[$i]['goods_name'] . PHP_EOL;
            file_put_contents('amf_list.txt', $str, FILE_APPEND);
        }
    }
}
get_product_list();
Example #2
0
function products_list($select = 0, $ignore = 0)
{
    echo get_product_list($select, $ignore);
}
Example #3
0
?>
/images/product_2.jpg"  alt="Product"/><span>Product One</span></a></li>

            <li><a href="#"><img src="<?php 
bloginfo('template_url');
?>
/images/product_2.jpg"  alt="Product"/><span>Product One</span></a></li>

            <li><a href="#"><img src="<?php 
bloginfo('template_url');
?>
/images/product_2.jpg"  alt="Product"/><span>Product One</span></a></li>
        </ul> -->
        <ul class="list-unstyled">
            <?php 
echo get_product_list($cat_id);
?>
        </ul>
       </div>

        </div>

      

    </div>

  </div>

  <!--/top content--> 

<?php 
Example #4
0
 function add_book()
 {
     global $set, $db, $apx;
     $thistype = 'book';
     if ($_POST['send'] == 2) {
         //Begriff bereits vorhanden?
         $duplicate = false;
         if ($_POST['send'] == 2 && !$_POST['ignore']) {
             list($duplicate) = $db->first("SELECT id FROM " . PRE . "_products WHERE title LIKE '" . addslashes($_POST['title']) . "' LIMIT 1");
         }
         if (!checkToken()) {
             infoInvalidToken();
         } elseif (!$_POST['title'] || !$_POST['text']) {
             infoNotComplete();
         } elseif ($duplicate) {
             info($apx->lang->get('MSG_DUPLICATE'));
             echo '<script type="text/javascript"> parent.document.forms[0].ignore.value = 1; </script>';
         } elseif (!$this->update_pic()) {
             /*DO NOTHING*/
         } elseif (!$this->update_teaserpic()) {
             /*DO NOTHING*/
         } else {
             //Website-URLs clean
             if (substr($_POST['website'], 0, 4) == 'www.') {
                 $_POST['website'] = 'http://' . $_POST['website'];
             }
             $_POST['type'] = $thistype;
             $_POST['addtime'] = time();
             $_POST['picture'] = $this->picpath;
             $_POST['teaserpic'] = $this->teaserpicpath;
             $_POST['media'] = dash_serialize(array_map('intval', $_POST['media']));
             //Freischalten
             if ($apx->user->has_right('products.enable') && $_POST['pubnow']) {
                 $_POST['active'] = 1;
             } else {
                 $_POST['active'] = 0;
             }
             $db->dinsert(PRE . '_products', 'prodid,type,title,text,meta_description,picture,teaserpic,website,manufacturer,publisher,isbn,genre,media,custom1,custom2,custom3,custom4,custom5,custom6,custom7,custom8,custom9,custom10,buylink,price,recprice,guarantee,recprice,guarantee,addtime,allowcoms,allowrating,restricted,top,searchable,active');
             $nid = $db->insert_id();
             logit('PRODUCTS_ADD', 'ID #' . $nid);
             //Inlinescreens
             mediamanager_setinline($nid);
             //Release eintragen
             for ($i = 1; $i <= 10; $i++) {
                 if (!isset($_POST['release'][$i])) {
                     continue;
                 }
                 $element = $_POST['release'][$i];
                 if ($element['year']) {
                     list($reldata, $relstamp, $relsystem) = $this->generate_release($element);
                     $db->query("INSERT INTO " . PRE . "_products_releases (prodid,system,data,stamp) VALUES ('" . $nid . "','" . $relsystem . "','" . addslashes(serialize($reldata)) . "','" . $relstamp . "')");
                 }
             }
             //Tags
             $tagids = produceTagIds($_POST['tags']);
             foreach ($tagids as $tagid) {
                 $db->query("INSERT IGNORE INTO " . PRE . "_products_tags VALUES('" . $nid . "', '" . $tagid . "')");
             }
             if ($_REQUEST['updateparent']) {
                 printJSUpdateObject($_REQUEST['updateparent'], get_product_list($nid));
             } else {
                 printJSRedirect('action.php?action=products.show&what=' . $thistype);
             }
         }
     } else {
         $_POST['allowcoms'] = 1;
         $_POST['allowrating'] = 1;
         $_POST['searchable'] = 1;
         $_POST['pubnow'] = 1;
         $_POST['media'] = array();
         //Benutzerdefinierte Felder
         for ($i = 1; $i <= 10; $i++) {
             $fieldname = $set['products']['custom_' . $thistype][$i - 1];
             $apx->tmpl->assign('CUSFIELD' . $i . '_NAME', replace($fieldname));
             $apx->tmpl->assign('CUSTOM' . $i, compatible_hsc($_POST['custom' . $i]));
         }
         $apx->tmpl->assign('ACTION', 'add');
         $apx->tmpl->assign('PRODID', intval($_POST['prodid']));
         $apx->tmpl->assign('TITLE', compatible_hsc($_POST['title']));
         $apx->tmpl->assign('TEXT', compatible_hsc($_POST['text']));
         $apx->tmpl->assign('META_DESCRIPTION', compatible_hsc($_POST['meta_description']));
         $apx->tmpl->assign('PIC_COPY', compatible_hsc($_POST['pic_copy']));
         $apx->tmpl->assign('TEASERPIC_COPY', compatible_hsc($_POST['teaserpic_copy']));
         $apx->tmpl->assign('WEBSITE', compatible_hsc($_POST['website']));
         $apx->tmpl->assign('TAGS', compatible_hsc($_POST['tags']));
         $apx->tmpl->assign('MANUFACTURER', $this->get_units($_POST['manufacturer'], iif($set['products']['filtermanu'], 'person')));
         $apx->tmpl->assign('PUBLISHER', $this->get_units($_POST['publisher'], iif($set['products']['filtermanu'], 'company')));
         $apx->tmpl->assign('ISBN', compatible_hsc($_POST['isbn']));
         $apx->tmpl->assign('GENRELIST', $this->get_genre($thistype, $_POST['genre']));
         $apx->tmpl->assign('MEDIALIST', $this->get_media($thistype, $_POST['media']));
         $apx->tmpl->assign('RELEASE', $this->get_release($thistype));
         $apx->tmpl->assign('BUYLINK', compatible_hsc($_POST['buylink']));
         $apx->tmpl->assign('PRICE', compatible_hsc($_POST['price']));
         $apx->tmpl->assign('RECPRICE', compatible_hsc($_POST['recprice']));
         $apx->tmpl->assign('GUARANTEE', compatible_hsc($_POST['guarantee']));
         $apx->tmpl->assign('ALLOWCOMS', (int) $_POST['allowcoms']);
         $apx->tmpl->assign('ALLOWRATING', (int) $_POST['allowrating']);
         $apx->tmpl->assign('RESTRICTED', (int) $_POST['restricted']);
         $apx->tmpl->assign('TOP', (int) $_POST['top']);
         $apx->tmpl->assign('SEARCHABLE', (int) $_POST['searchable']);
         $apx->tmpl->assign('PUBNOW', (int) $_POST['pubnow']);
         $apx->tmpl->assign('UPDATEPARENT', (int) $_POST['updateparent']);
         $apx->tmpl->parse('add_edit_' . $thistype);
     }
 }
Example #5
0
<a data-toggle="modal" href="#myModal" id="modal-product_list"></a>

<!-- Modal -->
<div class="modal fade" id="myModal" tabindex="-1" role="dialog" aria-labelledby="myModalLabel" aria-hidden="true">
    <div class="modal-dialog" style="width:800px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" aria-hidden="true">&times;</button>
          <h4 class="modal-title"><?php 
lang('Account List');
?>
</h4>
        </div>
        <div class="modal-body">
            <?php 
get_product_list(array('product_code' => 'code', 'product_sale_price' => 'quantity_price', 'product_tax_rate' => 'tax_rate', 'RUN' => 'calc();'));
?>
        </div>
        
      </div><!-- /.modal-content -->
    </div><!-- /.modal-dialog -->
</div><!-- /.modal -->


<?php 
if (isset($_POST['item']) and is_log()) {
    $continue = true;
    $this->form_validation->set_rules('code', get_lang('Barcode Code'), 'required');
    $this->form_validation->set_rules('amount', get_lang('Amount'), 'required|digits');
    $this->form_validation->set_rules('quantity_price', get_lang('Quantity Price'), 'number');
    $this->form_validation->set_rules('tax_rate', get_lang('Tax Rate'), 'digits');