ok
Direktori : /home2/selectio/www/lilyexpresslive/software/admin/emergency-code/ |
Current File : /home2/selectio/www/lilyexpresslive/software/admin/emergency-code/customer-db-code-update.php |
<?php include("../inc/config.php"); //Delete Pickup Entry Details //if(isset($_POST['type']) && $_POST['type']=="last_date_pickup_entry"){ $response='';$sql=''; $limit=50; $statement = $pdo->prepare("SELECT count(id) as count FROM `pickup_entry` WHERE pickup_customer_name is NULL"); $statement->execute(); $s_results = $statement->fetchAll(PDO::FETCH_ASSOC); echo "Remaining Count :".$s_results[0]['count'].'<br><br>'; //error_log('Cron Job Working...'); $statement = $pdo->prepare("SELECT pickup_entry.id,pickup_entry.ref_no,pickup_entry.customer_id,pickup_entry.pickup_customer_name,tbl_customer.cust_id,tbl_customer.cust_name,tbl_customer.cust_code FROM `pickup_entry` inner JOIN tbl_customer on pickup_entry.customer_id=tbl_customer.cust_id WHERE pickup_entry.pickup_customer_name is NULL LIMIT $limit"); $statement->execute(); $totals = $statement->rowCount(); $results = $statement->fetchAll(PDO::FETCH_ASSOC); if($totals>0){ $i=1; foreach($results as $rows){ $statement = $pdo->prepare("UPDATE pickup_entry SET pickup_customer_name=?,pickup_customer_dbcode=? WHERE customer_id=?"); $resultls=$statement->execute(array($rows['cust_name'],$rows['cust_code'],$rows['customer_id'])); if($resultls){echo $i." .success <br>"; }else{echo $i." .invalid<br>";} $i++; } }else{ echo "<br>invalid<br>";} ?>