示例#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;
 }
示例#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 : '';
示例#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;
 }
示例#4
0
$user = new userclass();
$loginname = htmlspecialchars($_POST['username'], ENT_QUOTES);
$password = $_POST['password'];
$passwordencoded = md5($password);
$adminuser_id = '';
$result = $user->GetLoginDetails($loginname, $passwordencoded);
$adminuser_id = $result['id'];
$adminusername = $result['name'];
//if username exists
if (!empty($adminuser_id)) {
    //now set the session from here if needed
    $_SESSION['ADMINUSERID'] = $adminuser_id;
    $_SESSION['ADMINUSERNAME'] = $adminusername;
    $_SESSION['start'] = time();
    // taking now logged in time
    $_SESSION['expire'] = $_SESSION['start'] + 18 * 60;
    $user->createlog("User {$adminusername} Logged In");
    updateloginlog($adminuser_id, $user, commonclass::GetIP());
    echo 'yes';
} else {
    $_SESSION['ADMINUSERID'] = '';
    $_SESSION['ADMINUSERNAME'] = '';
    echo "<span class=\"label label-important\">Username / Password incorrect !</span>";
}
function updateloginlog($adminuser_id, $user, $ip)
{
    $loginTime = date('Y-m-d H:i:s');
    $sql_update_login = "******";
    $updatevalue = $user->internalDB->query($sql_update_login);
    return $updatevalue;
}
示例#5
0
        !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();
    !empty($data['name']) ? $insertData['name'] = trim($data['name']) : '';
    !empty($data['season']) ? $insertData['season'] = trim($data['season']) : '';
    !empty($data['mercandiser']) ? $insertData['mercandiser'] = trim($data['mercandiser']) : '';
    !empty($data['quantity']) ? $insertData['quantity'] = trim($data['quantity']) : '';
    !empty($data['gsm']) ? $insertData['gsm'] = trim($data['gsm']) : '';
    !empty($data['excess_percent']) ? $insertData['excess_percent'] = trim($data['excess_percent']) : '';
    !empty($data['delivery_date']) ? $insertData['delivery_date'] = commonclass::cleandate($data['delivery_date']) : '';
    !empty($data['order_date']) ? $insertData['order_date'] = commonclass::cleandate($data['order_date']) : '';
    !empty($data['delivery_type']) ? $insertData['delivery_type'] = $data['delivery_type'] : '';
    $insertData['created_on'] = $today;
    $insertOrder = $this->internalDB->insert('d_order', $insertData);
    $affectedid = $this->internalDB->insertId();
    $this->createlog("Candidate  {$affectedid} created");
    return $affectedid;
}
示例#6
0
<?php

$today = commonclass::to_ist(commonclass::to_gmt(time()));
$today = date("y-m-d H:i:s", $candidate_registered_on);
foreach ($yarndetails as $data) {
    if ($data['id'] != 0) {
        try {
            $yarnid = $data['id'];
            $candobj = $this->internalDB->queryFirstRow("select * from d_yarn where id=" . $yarnid);
            $datatoupdate = array();
            !empty($data['count']) ? $datatoupdate['count'] = trim($data['count']) : '';
            !empty($data['color']) ? $datatoupdate['color'] = trim($data['color']) : '';
            !empty($data['kgs']) ? $datatoupdate['kgs'] = trim($data['kgs']) : '';
            !empty($orderId) ? $datatoupdate['order_id'] = trim($data['order_id']) : '';
            $datatoupdate['modified_on'] = $today;
            $candidatetable = $this->internalDB->update('d_yarn', $datatoupdate, "id=%i", $yarnid);
            $affectedrows = $this->internalDB->affectedRows();
        } catch (Exception $ex) {
            return getMessage();
        }
    } else {
        $insertData = array();
        !empty($data['count']) ? $insertData['count'] = trim($data['count']) : '';
        !empty($data['color']) ? $insertData['color'] = trim($data['color']) : '';
        !empty($data['kgs']) ? $insertData['kgs'] = trim($data['kgs']) : '';
        !empty($orderId) ? $insertData['order_id'] = trim($data['order_id']) : '';
        $insertData['created_on'] = $today;
        $insertOrder = $this->internalDB->insert('d_yarn', $insertData);
        $affectedid = $this->internalDB->insertId();
        $this->createlog("Yarn  {$affectedid} created");
    }