本文整理汇总了PHP中Products::UpdateProduct方法的典型用法代码示例。如果您正苦于以下问题:PHP Products::UpdateProduct方法的具体用法?PHP Products::UpdateProduct怎么用?PHP Products::UpdateProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Products
的用法示例。
在下文中一共展示了Products::UpdateProduct方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Products
<?if($_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest'){
header('Content-Type: text/javascript; charset=utf-8');
$Products = new Products();
if(isset($_POST['action']))
switch($_POST['action']){
case 'specification_update':
$Specification = new Specification();
$Products->UpdateProduct(array('id_product'=>$_POST['id_product']));
if($_POST['id_spec_prod'] == ''){
if($Specification->AddSpecToProd($_POST, $_POST['id_product'])){
echo json_encode('ok');
}
}else{
if($Specification->UpdateSpecsInProducts($_POST)){
echo json_encode('ok');
}
}
break;
case 'update_translit':
echo json_encode($Products->UpdateTranslit($_POST['id_product']));
break;
case 'datalist':
echo json_encode($Products->GetIdOneRowArrayByArt($_POST['article']));
break;
case 'datalist_supplier':
$Supplier = new Suppliers();
echo json_encode($Supplier->GetIdOneRowArrayByArt($_POST['article']));
break;
case 'insert_related':
echo json_encode($Products->AddRelatedProduct($_POST['id_prod'], $_POST['id_related_prod']));
break;
示例2: date
$tpl->Assign('list_segment_types', $segmentation->GetSegmentationType());
if (isset($_GET['upload']) == true) {
$res = $Images->upload($_FILES, $GLOBALS['PATH_product_img'] . 'original/' . date('Y') . '/' . date('m') . '/' . date('d') . '/');
echo str_replace($GLOBALS['PATH_root'], '/', $res);
exit(0);
}
if (isset($_GET['action']) && $_GET['action'] == "update_spec") {
if ($_GET['id_spec_prod'] == '') {
$specification->AddSpecToProd($_GET, $id_product);
} else {
$specification->UpdateSpecsInProducts($_GET);
}
header('Location: ' . $GLOBALS['URL_base'] . 'adm/productedit/' . $id_product);
} elseif (isset($_GET['action']) && $_GET['action'] == "delete_spec") {
$specification->DelSpecFromProd($_GET['id_spec_prod']);
$Products->UpdateProduct(array('id_product' => $id_product));
header('Location: ' . $GLOBALS['URL_base'] . 'adm/productedit/' . $id_product);
}
if (isset($_POST['smb']) || isset($_POST['smb_new'])) {
require_once $GLOBALS['PATH_block'] . 't_fnc.php';
// для ф-ции проверки формы
if (isset($_POST['price']) && $_POST['price'] == "") {
$_POST['price'] = 0;
}
list($err, $errm) = Product_form_validate();
if (!$err) {
if (isset($_POST['images']) && !empty($_POST['images'])) {
$to_resize = array();
//Физическое удалание файлов
if (isset($_POST['removed_images']) && !empty($_POST['removed_images'])) {
foreach ($_POST['removed_images'] as $k => $path) {