Ejemplo n.º 1
0
 public function updatecatalogmasterlist($catalogmasterid, $catalogmastername, $description, $addedcatalogs, $removedcatalogs, $enabledcatalogs, $disabledcatalogs)
 {
     $affectedrows = 0;
     $temp = commonclass::to_ist(commonclass::to_gmt(time()));
     $createdon = date("y-m-d H:i:s", $temp);
     $catalogmasterid = empty($catalogmasterid) ? $this->addNewCatalogmaster($catalogmastername, $description, $createdon) : $catalogmasterid;
     if (!empty($removedcatalogs)) {
         $affectedrows = $this->removecatalogvalues($removedcatalogs);
     }
     if (!empty($addedcatalogs)) {
         $affectedrows = $this->addNewcatalogvalues($addedcatalogs, $catalogmasterid, $createdon);
     }
     if (!empty($enabledcatalogs)) {
         $affectedrows = $this->enablecatalogvalues($enabledcatalogs);
     }
     if (!empty($disabledcatalogs)) {
         $affectedrows = $this->disablecatalogvalues($disabledcatalogs);
     }
     return $affectedrows > 0 ? $catalogmasterid : 0;
 }
Ejemplo n.º 2
0
<?php

$temp = commonclass::to_ist(commonclass::to_gmt(time()));
$today = date("y-m-d H:i:s", $temp);
$updateObject = array();
$returnValue = array();
try {
    if (!empty($entity['eventid'])) {
        $duplicate = $this->internalDB->queryFirstRow("select id from events where  name='" . $entity['eventname'] . "' AND id!=" . $entity['eventid']);
        if (!empty($duplicate)) {
            return array("Exception" => "Specified event name already exists");
        }
        isset($entity['eventname']) ? $updateObject['name'] = $entity['eventname'] : '';
        isset($entity['description']) ? $updateObject['description'] = $entity['description'] : '';
        isset($entity['icons']) ? $updateObject['icons'] = $entity['icons'] : '';
        isset($entity['file_name']) ? $updateObject['images'] = $entity['file_name'] : '';
        isset($ritualIds) ? $updateObject['rituals'] = $ritualIds : '';
        isset($serviceIds) ? $updateObject['services'] = $serviceIds : '';
        $this->internalDB->update('events', $updateObject, "id=%i", $entity['eventid']);
        $returnValue['Id'] = $entity['eventid'];
    } else {
        $duplicate = $this->internalDB->queryFirstRow("select id from events where  name='" . $entity['eventname'] . "'");
        if (!empty($duplicate)) {
            return array('Exception' => "Specified event name already exists");
        }
        isset($entity['eventname']) ? $updateObject['name'] = $entity['eventname'] : '';
        isset($entity['description']) ? $updateObject['description'] = $entity['description'] : '';
        isset($entity['icons']) ? $updateObject['icons'] = $entity['icons'] : '';
        isset($entity['file_name']) ? $updateObject['images'] = $entity['file_name'] : '';
        isset($ritualIds) ? $updateObject['rituals'] = $ritualIds : '';
        isset($serviceIds) ? $updateObject['services'] = $serviceIds : '';
Ejemplo n.º 3
0
 public function updatecatalogmasterlist($catalogmasterid, $catalogmastername, $description, $addedcatalogs, $removedcatalogs, $enabledcatalogs, $disabledcatalogs)
 {
     $response = array();
     $affectedrows = 0;
     try {
         $temp = commonclass::to_ist(commonclass::to_gmt(time()));
         $createdon = date("y-m-d H:i:s", $temp);
         $catalogmasterid = empty($catalogmasterid) ? $this->addNewCatalogmaster($catalogmastername, $description, $createdon) : $catalogmasterid;
         if (!empty($removedcatalogs)) {
             $affectedrows = $this->removecatalogvalues($removedcatalogs);
         }
         if (!empty($addedcatalogs)) {
             $affectedrows = $this->addNewcatalogvalues($addedcatalogs, $catalogmasterid, $createdon);
         }
         if (!empty($enabledcatalogs)) {
             $affectedrows = $this->enablecatalogvalues($enabledcatalogs);
         }
         if (!empty($disabledcatalogs)) {
             $affectedrows = $this->disablecatalogvalues($disabledcatalogs);
         }
     } catch (Exception $ex) {
         $response['Exception'] = $ex->getMessage();
     }
     return $response;
     $affectedrows > 0 ? $response['Id'] = $catalogmasterid : ($response['Exception'] = "Error in saving Catalogs");
     return $response;
 }
Ejemplo n.º 4
0
<?php

$today = commonclass::to_ist(commonclass::to_gmt(time()));
$today = date("y-m-d H:i:s", $candidate_registered_on);
if ($data['orderid'] != 0) {
    try {
        $orderid = $data['id'];
        $candobj = $this->internalDB->queryFirstRow("select * from d_order where id=" . $orderid);
        $datatoupdate = array();
        !empty($data['name']) ? $datatoupdate['name'] = trim($data['name']) : '';
        !empty($data['season']) ? $datatoupdate['season'] = trim($data['season']) : '';
        !empty($data['mercandiser']) ? $datatoupdate['mercandiser'] = trim($data['mercandiser']) : '';
        !empty($data['quantity']) ? $datatoupdate['quantity'] = trim($data['quantity']) : '';
        !empty($data['gsm']) ? $datatoupdate['gsm'] = trim($data['gsm']) : '';
        !empty($data['excess_percent']) ? $datatoupdate['excess_percent'] = trim($data['excess_percent']) : '';
        !empty($data['delivery_date']) ? $datatoupdate['delivery_date'] = commonclass::cleandate($data['delivery_date']) : '';
        !empty($data['order_date']) ? $datatoupdate['order_date'] = commonclass::cleandate($data['order_date']) : '';
        !empty($data['delivery_type']) ? $datatoupdate['delivery_type'] = $data['delivery_type'] : '';
        $datatoupdate['modified_on'] = $today;
        $candidatetable = $this->internalDB->update('d_order', $datatoupdate, "id=%i", $orderid);
        $affectedrows = $this->internalDB->affectedRows();
        if ($affectedrows >= 0) {
            $this->createlog("Order  {$orderid} updated");
            return 1;
        }
    } catch (Exception $ex) {
        return getMessage();
    }
} else {
    $candidate_registered_ip = commonclass::GetIP();
    $insertData = array();