<h4>Please select a delivery date</h4> <?php echo form_error('delivery_date', '<div class="err">', '</div>'); ?> <div class="action"> <a href="#" class="btn btn-default" id="datepicker"><span id="show_date">Delivery Date</span> <span class="caret" style="color: #FFF;"></span></a> <button type="submit" class="btn btn-primary">Add to Cart</button> <input type="hidden" name="delivery_date" id="delivery_date" value="" > <input type="hidden" name="product_id" value="<?php echo $product->product_id; ?> "> <div class="calendar-container"> <div id="calendar"> <?php echo calendars(); ?> </div> </div> </div> <div id="reduced_des" class="product-description" style="text-align:justify;"> <?php if (strlen(rightLang($product->product_description, $product->product_description_fr)) > 390) { ?> <?php echo substr(rightLang($product->product_description, $product->product_description_fr), 0, 390) . ' ... '; ?> <a href="javascript:;" onClick="showInf1();">see more</a> <?php } else { ?>
function show_ligne($value, $color, $id_field, $ajout, $form_name) { global $optSelectField, $opt2SelectField, $opt2Select, $optSelect2Field, $opt3Select, $optSelect, $optArray, $l, $protectedPost; $nameField = $value . "-" . $id_field; if ($ajout != '') { $and_or = show_modif(array('AND' => 'AND', 'OR' => 'OR'), "SelAndOr-" . $nameField, 2, '', array('DEFAULT' => 'NO')); } //si le champ comporte une valeur du champ select par défaut if (array_key_exists($value . '-SELECT', $optArray)) { //on prend les valeurs du champ $champ_select = $optArray[$value . '-SELECT']; } else { //si on garde les valeurs par défaut $champ_select = array('exact' => $l->g(410), 'ressemble' => $l->g(129), 'diff' => $l->g(130)); } //on génére le premier champ select $select = "<select name='SelComp-" . $nameField . "' id='SelComp-" . $nameField . "' class='down'>"; $countHl = 0; foreach ($champ_select as $k => $v) { //si un javascript a été passé en paramètre if ($k != 'javascript') { //on remplace la chaine générique field_name du javascript par le vrai nom de champ $champ_select['javascript'][$k] = str_replace("field_name", $nameField, $champ_select['javascript'][$k]); $select .= "<option value='" . $k . "' " . ($protectedPost['SelComp-' . $nameField] == $k ? " selected" : "") . " " . $champ_select['javascript'][$k] . " " . ($countHl % 2 == 1 ? " class='hi'" : " class='down'") . " >" . $v . "</option>"; } $countHl++; } $select .= "</select>"; //on affiche le début de ligne echo "<div class='field search-field'><a href=\"javascript:;\"><img src='image/delete-small.png' onclick='pag(\"" . $id_field . "\",\"delfield\",\"" . $form_name . "\");'></a>"; if ($ajout != '') { echo $and_or; } echo " " . $optArray[$value] . ' '; //TITRE,CHAMP (EGAL,LIKE,NOTLIKE),valeur if (array_key_exists($value, $optSelectField)) { echo $select . " <input type='text' name='InputValue-" . $nameField . "' class='down' id='InputValue-" . $nameField . "' value=\"" . stripslashes($protectedPost["InputValue-" . $nameField]) . "\"> "; if ($optSelectField[$value . "-LBL"] == "calendar") { echo calendars("InputValue-" . $nameField, $l->g(1270)); } echo "</div>"; //echo $value."-LBL".$id_field; } //TITRE,CHAMPSELECT,(pour $optSelect) //et les champs suivants en plus pour $opt2SelectField: CHAMP (EGAL,LIKE,NOTLIKE) et valeur if (array_key_exists($value, $opt2SelectField) or array_key_exists($value, $optSelect)) { if (array_key_exists($value, $opt2SelectField)) { $data = $opt2SelectField; //nom en Value3 car le traitement doit se faire sur la valeur de ce champ (cas particulier) $name_select = 'SelFieldValue3'; } else { $data = $optSelect; $name_select = 'SelFieldValue'; } $select2 = "<select name='" . $name_select . "-" . $nameField . "' id='" . $name_select . "-" . $nameField . "'>"; if (is_array($data[$value . '-SQL1'])) { foreach ($data[$value . '-SQL1'] as $k => $v) { $select2 .= "<option value='" . $k . "' " . ($protectedPost[$name_select . "-" . $nameField] == $k ? " selected" : "") . ">" . $v . "</option>"; } } else { $result = mysqli_query($_SESSION['OCS']["readServer"], $data[$value . '-SQL1']); while ($val = mysqli_fetch_array($result)) { $val = data_encode_utf8($val); foreach ($val as $name_of_field => $value_of_request) { if (!is_numeric($name_of_field) and $name_of_field != 'ID') { if (!isset($val['ID'])) { $val['ID'] = $value_of_request; } // echo $val['ID']."=>".$value_of_request."<br>"; $select2 .= "<option value='" . $val['ID'] . "' " . ($protectedPost[$name_select . '-' . $nameField] == $val['ID'] ? " selected" : "") . ">" . $value_of_request . "</option>"; } } } } $select2 .= "</select>"; echo $select2; if (array_key_exists($value, $opt2SelectField)) { if ($opt2SelectField[$value . "-LBL"] == "calendar") { $opt2SelectField[$value . "-LBL"] = calendars("InputValue-" . $nameField, $l->g(1270)); } echo $select . " <input name='InputValue-" . $nameField . "' id='InputValue-" . $nameField . "' value=\"" . stripslashes($protectedPost["InputValue-" . $nameField]) . "\"> " . $opt2SelectField[$value . "-LBL"]; } echo "</div>"; } //TITRE,CHAMP (EGAL,LIKE,NOTLIKE),CHAMPSELECT if (array_key_exists($value, $opt2Select)) { $selectValue = "<select name='SelFieldValue-" . $nameField . "' id='SelFieldValue-" . $nameField . "' >"; if (is_array($opt2Select[$value . '-SQL1'])) { foreach ($opt2Select[$value . '-SQL1'] as $k => $v) { $selectValue .= "<option value='" . $k . "' " . ($protectedPost['SelFieldValue-' . $nameField] == $k ? " selected" : "") . ">" . $v . "</option>"; } } else { $result = mysqli_query($_SESSION['OCS']["readServer"], $opt2Select[$value . '-SQL1']); while ($val = mysqli_fetch_array($result)) { if (!isset($val['ID'])) { $val['ID'] = $val['NAME']; } $selectValue .= "<option value='" . $val['ID'] . "' " . ($protectedPost['SelFieldValue-' . $nameField] == $val['ID'] ? " selected" : "") . ">" . $val['NAME'] . "</option>"; } } $selectValue .= "</select>"; echo $select . $selectValue . " </div>"; } //TITRE,CHAMPSELECT,valeur1,valeur2 if (array_key_exists($value, $optSelect2Field)) { //gestion de la vision du deuxieme champ de saisi //on fonction du POST if ($protectedPost['SelComp-' . $nameField] == "between") { $display = "inline"; } else { $display = "none"; } echo $select . " <input name='InputValue-" . $nameField . "' id='InputValue-" . $nameField . "' value=\"" . stripslashes($protectedPost["InputValue-" . $nameField]) . "\">\n\t\t\t\t <div style='display:" . $display . "' id='FieldInput2-" . $nameField . "'> -- <input name='InputValue2-" . $nameField . "' value=\"" . stripslashes($protectedPost["InputValue2-" . $nameField]) . "\"></div>" . $optSelect2Field[$value . "-LBL"] . "</div>"; } if (array_key_exists($value, $opt3Select)) { $selectValue1 = "<select name='SelFieldValue-" . $nameField . "' id='SelFieldValue-" . $nameField . "'>"; $result = mysqli_query($_SESSION['OCS']["readServer"], $opt3Select[$value . '-SQL1']); while ($val = mysqli_fetch_array($result)) { if (!isset($val['ID'])) { $val['ID'] = $val['NAME']; } $selectValue1 .= "<option value='" . $val['ID'] . "' " . ($protectedPost['SelFieldValue-' . $nameField] == $val['ID'] ? " selected" : "") . ">" . $val['NAME'] . "</option>"; } $selectValue1 .= "</select>"; $selectValue2 = "<select name='SelFieldValue2-" . $nameField . "' id='SelFieldValue2-" . $nameField . "'>"; $result = mysqli_query($_SESSION['OCS']["readServer"], $opt3Select[$value . '-SQL2']); while ($val = mysqli_fetch_array($result)) { if (!isset($val['ID'])) { $val['ID'] = $val['NAME']; } $selectValue2 .= "<option value='" . $val['ID'] . "' " . ($protectedPost['SelFieldValue2-' . $nameField] == $val['ID'] ? " selected" : "") . ">" . $val['NAME'] . "</option>"; } $selectValue2 .= "</select>"; echo $select . " " . $l->g(667) . ":" . $selectValue1 . " " . $l->g(546) . ":" . $selectValue2 . "</div>"; } }
require_once 'require/function_admininfo.php'; $field_of_accountinfo = witch_field_more('COMPUTERS'); $tab_typ_champ = array(); $i = 0; $dont_show_type = array(8, 3); foreach ($field_of_accountinfo['LIST_FIELDS'] as $id => $lbl) { if (!in_array($field_of_accountinfo['LIST_TYPE'][$id], $dont_show_type)) { if ($field_of_accountinfo['LIST_NAME'][$id] == "TAG") { $truename = "TAG"; } else { $truename = "fields_" . $id; } if ($field_of_accountinfo['LIST_TYPE'][$id] == 6) { $tab_typ_champ[$i]['CONFIG']['MAXLENGTH'] = 10; $tab_typ_champ[$i]['CONFIG']['SIZE'] = 10; $tab_typ_champ[$i]['COMMENT_AFTER'] = calendars($truename, "DDMMYYYY") . "</a></td><td><input type='checkbox' name='check" . $truename . "' id='check" . $truename . "' " . (isset($protectedPost['check' . $truename]) ? " checked " : "") . ">"; } elseif (in_array($field_of_accountinfo['LIST_TYPE'][$id], array(2, 4, 7))) { $sql = "select ivalue as ID,tvalue as NAME from config where name like 'ACCOUNT_VALUE_%s' order by 2"; $arg = $field_of_accountinfo['LIST_NAME'][$id] . "%"; $result = mysql2_query_secure($sql, $_SESSION['OCS']["readServer"], $arg); while ($val = mysqli_fetch_array($result)) { $tab_typ_champ[$i]['DEFAULT_VALUE'][$val['ID']] = $val['NAME']; } $tab_typ_champ[$i]['COMMENT_AFTER'] = "</td><td><input type='checkbox' name='check" . $truename . "' id='check" . $truename . "' " . (isset($protectedPost['check' . $truename]) ? " checked " : "") . ">"; } else { $tab_typ_champ[$i]['COMMENT_AFTER'] = "</td><td><input type='checkbox' name='check" . $truename . "' id='check" . $truename . "' " . (isset($protectedPost['check' . $truename]) ? " checked " : "") . ">"; $tab_typ_champ[$i]['CONFIG']['MAXLENGTH'] = 100; $tab_typ_champ[$i]['CONFIG']['SIZE'] = 30; } $tab_typ_champ[$i]['INPUT_NAME'] = $truename; $tab_typ_champ[$i]['INPUT_TYPE'] = $convert_type[$field_of_accountinfo['LIST_TYPE'][$id]];