function insertToOTD($orderId, $discountId, $discountAmount)
 {
     if (isset($discountId) && $discountId != 0) {
         $insertQuery = "INSERT INTO OrderToDiscounts (orderId,discountId,discountAmount)\n\t\t\t\t\t\t\t\t\t\t\t\t\tVALUES ({$orderId},{$discountId},{$discountAmount})";
         parent::executeQuery($insertQuery);
     }
 }
예제 #2
0
 function insertToAdmins($title, $fname, $mname, $lname, $address, $city, $state, $zip, $homeTel, $workTel, $cellTel, $contactPerson, $contactTel)
 {
     $insertQuery = "INSERT INTO Admins (title,fname,mname,lname,address,city,state,zip,homeTel,workTel,cellTel,contactPerson,contactTel,passwd,email)\n\t\t\t\t            VALUES ('{$title}','{$fname}','{$mname}','{$lname}','{$address}','{$city}','{$state}','{$zip}','{$homeTel}','{$workTel}','{$cellTel}','{$contactPerson}','{$contactTel}',MD5('{$this->email}'),'{$this->email}')";
     parent::executeQuery($insertQuery);
     $query = "SELECT LAST_INSERT_ID()";
     $rs = parent::query($query);
     return parent::validateIndexes($rs, 0, 'last_insert_id()');
 }
예제 #3
0
 function insertToCTP($categId, $prodId)
 {
     if ($this->categId == 0 || $this->prodId == 0) {
         $insertQuery = "INSERT INTO ProdsToCategs\t(categId,prodId)\n\t\t\t\t\t\t\t\t         VALUES\t\t\t({$categId},{$prodId})";
     } else {
         $insertQuery = "INSERT INTO Categories\t(categId,prodId) \n\t\t\t\t\t\t\t\t\t\t VALUES\t\t({$this->categId},{$this->prodId})";
     }
     parent::executeQuery($insertQuery);
 }
예제 #4
0
 function insertToOD($name, $classification, $methodInitialCost, $methodPercentageCost, $status)
 {
     if ($this->discountId == 0) {
         $insertQuery = "INSERT INTO Discounts (name,classification,,methodInitialCost,methodPercentageCost,status)\n\t\t\t\t\t\t\t\t         VALUES ('{$name}','{$description}','{$methodInitialCost}','{$status}','{$methodPercentageCost}')";
     } else {
         $insertQuery = "INSERT INTO Discounts (name,classification,,methodInitialCost,methodPercentageCost,status,discountId) \n\t\t\t\t\t\t\t\t\t\t VALUES ('{$name}','{$description}','{$methodInitialCost}','{$methodPercentageCost}','{$status}',{$this->discountId})";
     }
     parent::executeQuery($insertQuery);
 }
예제 #5
0
 function insertToOPM($name, $classification, $methodInitialCost, $methodPercentageCost, $status)
 {
     if ($this->paymentMethId == 0) {
         $insertQuery = "INSERT INTO PaymentMethods (name,classification,,methodInitialCost,methodPercentageCost,status)\n\t\t\t\t\t\t\t\t         VALUES ('{$name}','{$classification}','{$methodInitialCost}','{$methodPercentageCost}','{$status}')";
     } else {
         $insertQuery = "INSERT INTO PaymentMethods (name,classification,,methodInitialCost,methodPercentageCost,status,paymentMethId) \n\t\t\t\t\t\t\t\t\t\t VALUES ('{$name}','{$classification}','{$methodInitialCost}','{$methodPercentageCost}','{$status}',{$this->paymentMethId})";
     }
     parent::executeQuery($insertQuery);
 }
예제 #6
0
 function max()
 {
     $maxQuery = "SELECT  max(orderId) FROM Orders";
     $rs = parent::executeQuery($maxQuery);
     $maxInArray = $rs->fields;
     if (!isset($maxInArray['max(orderId)'])) {
         return 0;
     } else {
         return $maxInArray['max(orderId)'];
     }
 }
예제 #7
0
 function destroy($sessId)
 {
     //print "destroy";
     $query = "DELETE FROM Sessions WHERE sessId='{$sessId}'";
     if (($result = parent::executeQuery($query)) === false) {
         return false;
     } else {
         setcookie("storez", '', time() - 86400, "/", '', 1);
         return true;
     }
 }
예제 #8
0
 function insertToProducts($categId, $name, $description, $price, $status)
 {
     /*	if (productId == 0)
     				Use Auto_Increment to assign productId field
     			else
     				Assign the value passed in Constructor */
     if ($this->productId == 0) {
         $insertQuery = "INSERT INTO Products (categId,name,description,price,status)\n\t\t\t\t\t\t\t\t\t        VALUES ({$categId},'{$name}','{$description}',{$price},{$status})";
     } else {
         $insertQuery = "INSERT INTO Products (categId,name,description,price,status,productId) \n\t\t\t\t\t\t\t\t\t\t\tVALUES ({$categId},'{$name}','{$description}',{$price},{$status},{$this->productId})";
     }
     parent::executeQuery($insertQuery);
 }
예제 #9
0
 function insertToCategs($parentId, $name, $description, $position)
 {
     /*	if (categid == 0)
     				Use Auto_Increment to assign categId field
     			else
     				Assign the value passed in Constructor */
     if ($this->categId == 0) {
         $insertQuery = "INSERT INTO Categories (parentId,name,description,position)\n\t\t\t\t\t\t\t\t         VALUES ({$parentId},'{$name}','{$description}',{$position})";
     } else {
         $insertQuery = "INSERT INTO Categories (parentId,name,description,position,categId) \n\t\t\t\t\t\t\t\t\t\t VALUES ({$parentId},'{$name}','{$description}',{$position},{$this->categId})";
     }
     parent::executeQuery($insertQuery);
 }
예제 #10
0
 function insertToOTP($orderId, $basket)
 {
     $size = sizeof($basket);
     for ($i = 0; $i < $size; $i++) {
         $productId = $basket[$i][0];
         $productQuantity = $basket[$i][1];
         if ($this->orderId == 0) {
             $insertQuery = "INSERT INTO OrderToProds (orderId,productId,productQuantity)\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES ({$orderId},{$productId},{$productQuantity})";
         } else {
             $insertQuery = "INSERT INTO OrderToProds (orderId,productId,productQuantity)\n                                                VALUES ({$this->orderId},{$productId},{$productQuantity})";
         }
         parent::executeQuery($insertQuery);
     }
 }
예제 #11
0
 function deleteUser($uid)
 {
     $query = "SELECT pic FROM Pics WHERE userId='{$uid}'";
     $pics = parent::query($query);
     //print_r($pics);
     foreach ($pics as $outer) {
         foreach ($outer as $pic) {
             $rmOrig = "./images/{$pic}";
             $rmThumb = "./images/thb_{$pic}";
             $rmPop = "./images/pop_{$pic}";
             $out = unlink($rmOrig);
             $out = unlink($rmThumb);
             $out = unlink($rmPop);
         }
     }
     $query = "DELETE from Pics WHERE userId = '{$uid}'";
     parent::executeQuery($query);
     $query = "DELETE from Users WHERE userId = '{$uid}'";
     return parent::executeQuery($query);
 }
 function insertToOTPM($orderId, $paymentId, $paymentCost, $paymentAmount)
 {
     $insertQuery = "INSERT INTO OrderToPaymentMeths (orderId,paymentId,paymentCost,paymentAmount)\n\t\t\t\t\t\t\t\t\t\t\tVALUES ({$orderId},{$paymentId},{$paymentCost},{$paymentAmount})";
     parent::executeQuery($insertQuery);
 }
예제 #13
0
 function insertToStores($address, $city, $state, $zip, $telephone)
 {
     $insertQuery = "INSERT INTO Stores (name,address,city,state,zip,telephone)\n\t\t                 VALUES ('{$this->storeName}','{$address}','{$city}','{$state}','{$zip}','{$telephone}')";
     parent::executeQuery($insertQuery);
 }
예제 #14
0
 function insertToOTU($orderId, $userId)
 {
     $insertQuery = "INSERT INTO OrderToUser (orderId,userId)\n\t\t\t\t\t\t\t\t\t\tVALUES\t({$orderId},{$userId})";
     parent::executeQuery($insertQuery);
 }
예제 #15
0
 function insertToTax($storeId, $taxZone, $rate, $description)
 {
     $insertQuery = "INSERT INTO Orders (storeId,taxZone,rate,description) \n\t\t\t\t\t\t\t\t\tVALUES ({$storeId},{$taxZone},{$rate},'{$description}')";
     parent::executeQuery($insertQuery);
 }
예제 #16
0
 function insertToAC($pics, $comment)
 {
     $insertQuery = "INSERT INTO AdminComments (pics,comments)\n\t\t\t\t\t\t\t\t\t\tVALUES ('{$pics}','{$comment}')";
     parent::executeQuery($insertQuery);
 }
예제 #17
0
 function updateUC($picId, $comment)
 {
     $picId = str_replace("_", ".", $picId);
     $comment = "UPDATE Pics SET userComment='{$comment}' WHERE pic='{$picId}'";
     parent::executeQuery($comment);
 }
예제 #18
0
 function insertToOTF($orderId, $currency, $subTotal, $taxAmt, $total, $changeDue)
 {
     $insertQuery = "INSERT INTO OrderToFinances\t(orderId,currency,subTotal,taxAmt,total,changeDue)\n\t\t\t\t\t\t\t\t\t\t\t\tVALUES\t({$orderId},'{$currency}',{$subTotal},{$taxAmt},{$total},{$changeDue})";
     parent::executeQuery($insertQuery);
 }