public function loadByName($name) { if (trim($name) != '') { $name = trim($name); $mysql = new mysql_class(); $ln1 = $mysql->ex_sqlx("insert into shahr_tmp (name) values ('{$name}') ", FALSE); $tmp_id = $mysql->insert_id($ln1); $mysql->close($ln1); $mysql->ex_sql("select name from shahr_tmp where id = {$tmp_id}", $q1); if (isset($q1[0])) { $name = $q1[0]['name']; } $mysql->ex_sqlx("delete from shahr_tmp where id = {$tmp_id}"); $mysql->ex_sql("select * from shahr where name='{$name}'", $q); if (isset($q[0])) { $r = $q[0]; $this->id = $q[0]['id']; $this->name = $q[0]["name"]; $this->en_name = $q[0]["en_name"]; } else { $ln = $mysql->ex_sqlx("insert into shahr (name) values ('{$name}') ", FALSE); $this->id = $mysql->insert_id($ln); $this->name = $name; $mysql->close($ln); } } }
public function decreaseSms($number, $user_id, $sanad_record_id, $status) { $mysql = new mysql_class(); $mysql->ex_sql("select `id` from `sms_charge` where `cont`<`maxi` order by `id` limit 1 ", $q); if ($isset($q[0])) { $mysql->ex_sqlx('update `sms_charge` set `cont`=`cont`+1 where `id`=' . $r['id']); } //--------------------------------------------------------- $mysql->ex_sqlx("insert into `sms` (`number`,`user_id`,`sanad_record_id`,`sent`) values ('{$number}','{$user_id}','{$sanad_record_id}','{$status}')"); }
function edit_item($id, $feild, $value) { if ($feild == 'frase') { $mysql = new mysql_class(); $mysql->ex_sql("select `id` from `access_det` where `acc_id` = (select `acc_id` from `access_det` where `id`={$id}) and `frase` = '{$value}'", $q); if (!isset($q[0])) { $mysql->ex_sqlx("update `access_det` set `frase` = '{$value}' where `id`={$id}"); } } else { $mysql->ex_sqlx("update `access_det` set `{$feild}` = '{$value}' where `id`={$id}"); } }
function write($id, $data) { $out = TRUE; $msql = new mysql_class(); $msql->enableCache = FALSE; $msql->ex_sql("select `id` from `session` where `id` = '{$id}'", $q); if (isset($q[0])) { $msql->ex_sqlx("update `session` set `lastUpdate` = '" . date("Y-m-d H:i:s") . "',`data`='{$data}' where `id` = '{$id}'"); } else { $msql->ex_sqlx("insert into `session` (`id`,`name`, `data`, `firstTime`, `lastUpdate`) values ('{$id}','" . $this->sessionName . "','{$data}','" . date("Y-m-d H:i:s") . "','" . date("Y-m-d H:i:s") . "')"); } return $out; }
function delete_item($id) { $mysql = new mysql_class(); $amount = 0; $customer_id = -1; $mysql->ex_sql("select `mablagh`,`customer_id` from `customer_daryaft` where `id` = '{$id}'", $q); if (isset($q[0])) { $amount = (int) $q[0]["mablagh"]; $customer_id = (int) $q[0]["customer_id"]; } $mysql->ex_sqlx("delete from `customer_daryaft` where `id` = '{$id}'"); $mysql->ex_sqlx("update `customers` set `max_amount`=`max_amount`-{$amount} where `id` = '{$customer_id}'"); }
function delete_item($table, $inp, $gname) { $my = new mysql_class(); $my->ex_sqlx("update `{$table}` set `tarikh` = now() - interval (`timeout` + 1) minute where `id` in ({$inp})"); ticket_class::clearTickets(); return TRUE; }
function addItem() { $fields = null; foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 4) == "new_") { if ($key != "new_id" && $key != 'new_tarikh') { $fields[substr($key, 4)] = $value; } } } $fields['app'] = conf::app; $fields['content'] = "<span style=\\'color:#000000;background-color:#4DFF29\\'>" . $fields['content'] . "</span>"; $fi = "("; $valu = "("; foreach ($fields as $field => $value) { $fi .= "`{$field}`,"; $valu .= "'{$value}',"; } $fi = substr($fi, 0, -1); $valu = substr($valu, 0, -1); $fi .= ")"; $valu .= ")"; $query = "insert into `admin` {$fi} values {$valu}"; mysql_class::ex_sqlx($query); }
public function add($tableName, $data, $query) { if ($tableName != '') { $createTime = date("Y-m-d H:i:s"); $mysql = new mysql_class(); $thisId = -1; $mysql->enableCache = FALSE; $mysql->directQuery("select `id` from `cache` where `tableName` = '{$tableName}' and `query` = '{$query}' ", $q); if ($r = $mysql->fetch_array($q)) { $thisId = $r['id']; } if ($thisId > 0) { $mysql->directQueryx("update `cache` set `data` = '" . serialize($data) . "' where `id` = '{$thisId}'"); } else { $ln = $mysql->ex_sqlx("insert into `cache` (`tableName`,`data`,`createTime`,`query`) values('{$tableName}','" . serialize($data) . "','{$createTime}','{$query}') ", FALSE); $thisId = (int) $mysql->insert_id($ln); $mysql->close($ln); } $this->id = $thisId; $this->tableName = $tableName; $this->data = $data; $this->query = $query; $this->createTime = $createTime; $this->viewCount = 1; } return $this->id; }
function delete_item($id) { $c = new customer_class($id); if (!$c->protected) { mysql_class::ex_sqlx("update `customers` set `en` = '0' where `id` = '{$id}'"); } }
function add_item() { $fields = null; $mysql = new mysql_class(); foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 4) == "new_") { if ($key != "new_id" && $key != "new_en") { $fields[substr($key, 4)] = $value; } } } $query = ''; $fi = "("; $valu = "("; foreach ($fields as $field => $value) { $fi .= "`{$field}`,"; $valu .= "'{$value}',"; } $fi = substr($fi, 0, -1); $valu = substr($valu, 0, -1); $fi .= ")"; $valu .= ")"; $query = "insert into `grop` {$fi} values {$valu}"; echo $query; $mysql->ex_sqlx($query); }
public function update($sanad_record_id) { $sanad_record_id = (int) $sanad_record_id; $sql = "update `pardakht` set `bank_out` = '" . $this->bank_out . "',`sanad_record_id` = '{$sanad_record_id}',`is_tmp` = 0 where `id` = " . $this->id; $mysql = new mysql_class(); $mysql->ex_sqlx($sql); }
function edit_item($id, $field, $value) { $parvaz_det_id = $GLOBALS['parvaz_det_id']; mysql_class::ex_sql('select `id` from `parvaz_jid` where `parvaz_det_id` = ' . $parvaz_det_id . ' and `jid` = ' . $value, $q); if (!($r = mysql_fetch_array($q))) { mysql_class::ex_sqlx('update `parvaz_jid` set `jid` = ' . $value . ' where `id` = ' . $id); } }
function edit_item($id, $feild, $value) { if ($feild != "rang") { mysql_class::ex_sqlx("update `parvaz` set `{$feild}` = '{$value}' where `id` = {$id}"); } else { mysql_class::ex_sqlx("update `parvaz` set `{$feild}` = '#{$value}' where `id` = {$id}"); } }
function clearTicket() { $mysql = new mysql_class(); $tarikh = date("Y-m-d H:i:s"); $mysql->ex_sqlx("update `parvaz_det` set `zarfiat`=`zarfiat`+(select SUM(`zarfiat`) from `reserve_tmp` where `parvaz_det_id` = `parvaz_det`.`id` and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) where `id` in (select `parvaz_det_id` from `reserve_tmp` where (not(`tedad` is null)) and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute))"); $mysql->ex_sqlx("update `customer_parvaz` set `zakhire`=`zakhire`+(select SUM(`zakhire`) from `reserve_tmp` where `customer_id` = `customer_parvaz`.`customer_id` and `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) where `parvaz_det_id` in (select `parvaz_det_id` from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)) and `customer_id` in (select `customer_id` from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute))"); $mysql->ex_sqlx("delete from `reserve_tmp` where `tarikh` <= SUBDATE('{$tarikh}' , interval `timeout` minute)"); //----------------------پﺍک کﺭﺪﻧ ﻅﺮﻓیﺕ ﻢﻬﻠﺗ ﺩﺍﺭ-- $mysql->ex_sqlx("update `customer_parvaz` set `zakhire` = 0 , regtime = '0000-00-00 00:00:00' WHERE `regtime` + interval `deadtime` minute < '{$tarikh}' and `deadtime` > 0"); /* //-----------------------پاک کردن بلیط موقت ----- mysql_class::ex_sqlx("update `parvaz_det` set `zarfiat`=`zarfiat`+(select SUM(`zarfiat`) from `reserve_tmp` where `parvaz_det_id` = `parvaz_det`.`id` and `tarikh` <= now() - interval `timeout` minute) where `id` in (select `parvaz_det_id` from `reserve_tmp` where (not(`tedad` is null)) and `tarikh` <= now() - interval `timeout` minute)"); mysql_class::ex_sqlx("update `customer_parvaz` set `zakhire`=`zakhire`+(select SUM(`zakhire`) from `reserve_tmp` where `customer_id` = `customer_parvaz`.`customer_id` and `tarikh` <= now() - interval `timeout` minute) where `parvaz_det_id` in (select `parvaz_det_id` from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute) and `customer_id` in (select `customer_id` from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute)"); mysql_class::ex_sqlx("delete from `reserve_tmp` where `tarikh` <= now() - interval `timeout` minute"); //----------------------پاک کردن ظرفیت مهلت دار-- mysql_class::ex_sqlx("update `customer_parvaz` set `zakhire` = 0 , regtime = '0000-00-00 00:00:00' WHERE `regtime` + interval `deadtime` minute < now() and `deadtime` > 0"); */ }
function setDetByAcc($grp_id, $page_name, $frase) { mysql_class::ex_sql("select `id` from `access` where `page_name`='{$page_name}' and `group_id`='{$grp_id}' ", $q); if ($r = mysql_fetch_array($q)) { if ($r['id'] > 0) { mysql_class::ex_sqlx("insert into `access_det` (`acc_id`,`frase`) values('" . $r['id'] . "','{$frase}') "); } } }
public function __set($key, $value) { $mysql = new mysql_class(); if ($value === TRUE) { $value = 'TRUE'; } if ($value === FALSE) { $value = 'FALSE'; } if (property_exists(__CLASS__, $key)) { $this->key = $value; } else { $mysql->ex_sql("select `value` from `conf` where `key` = '{$key}'", $q); if (isset($q[0])) { $mysql->ex_sqlx("update `conf` set `value` = '{$value}' where `key` = '{$key}'"); } else { $mysql->ex_sqlx("insert into `conf` (`key`,`value`) values ('{$key}','{$value}')"); } } }
function delete_item($table, $id, $gname) { $id = (int) $id; $c = new customer_class($id); $mysql = new mysql_class(); $out = FALSE; if (!$c->protected) { $out = $mysql->ex_sqlx("update `{$table}` set `en` = '0' where `id` = '{$id}'") == "ok"; } return $out; }
function edit_item($id, $feild, $value) { if ($feild == 'frase') { mysql_class::ex_sql("select `id` from `access_det` where `acc_id` = (select `acc_id` from `access_det` where `id`={$id}) and `frase` = '{$value}'", $q); if (!($r = mysql_fetch_array($q))) { mysql_class::ex_sqlx("update `access_det` set `frase` = '{$value}' where `id`={$id}"); } } else { mysql_class::ex_sqlx("update `access_det` set `{$feild}` = '{$value}' where `id`={$id}"); } }
function delete_item($id) { $amount = 0; $customer_id = -1; mysql_class::ex_sql("select `mablagh`,`customer_id` from `customer_daryaft` where `id` = '{$id}'", $q); if ($r = mysql_fetch_array($q)) { $amount = (int) $r["mablagh"]; $customer_id = (int) $r["customer_id"]; } mysql_class::ex_sqlx("delete from `customer_daryaft` where `id` = '{$id}'"); mysql_class::ex_sqlx("update `customers` set `max_amount`=`max_amount`-{$amount} where `id` = '{$customer_id}'"); }
public function add($inp_all, $sites_id, $add_ghimat) { $my = new mysql_class(); $tmp = ''; parvaz_det_tmp_class::disable_parvaz_det($sites_id); $okDets = array(); foreach ($inp_all as $inp) { $parvaz_id = $inp['parvaz']; $tarikh = $inp['date']; $saat = $inp['saat']; $zarfiat = (int) $inp['tedad']; $ghimat = $inp['ghimat'] + $add_ghimat; $my->ex_sql("select id,ghimat,zarfiat,en from parvaz_det where parvaz_id={$parvaz_id} and DATE(tarikh) = '{$tarikh}'", $q); //$my->ex_sql("select id,ghimat,zarfiat,en from parvaz_det where parvaz_id=$parvaz_id and tarikh='$tarikh' and saat='$saat' ",$q); if (isset($q[0])) { if ((int) $q[0]['en'] != 0) { $r = $q[0]; if ((int) $r['ghimat'] > $ghimat || ((int) $r['ghimat'] == $ghimat and $zarfiat != (int) $r['zarfiat']) || (int) $r['en'] == 3) { $my->ex_sqlx("delete from parvaz_det where id=" . $r['id']); $my->ex_sqlx("insert into parvaz_det (id,parvaz_id,tarikh,saat,zarfiat,ghimat,typ,toz,en) values (" . $r['id'] . ",'{$parvaz_id}','{$tarikh}','{$saat}','{$zarfiat}','{$ghimat}','0',''," . ((int) $q[0]['en'] == 3 ? 1 : $q[0]['en']) . ")"); $my->ex_sqlx("update parvaz_det_sites set sites_id={$sites_id} where parvaz_det_id =" . $r['id']); } } $okDets[] = (int) $r['id']; } else { $ln = $my->ex_sqlx("insert into parvaz_det (parvaz_id,tarikh,saat,zarfiat,ghimat,typ) values ('{$parvaz_id}','{$tarikh}','{$saat}','{$zarfiat}','{$ghimat}','0')", FALSE); $id_inp = (int) $my->insert_id($ln); $my->close($ln); if ($id_inp > 0) { $okDets[] = (int) $id_inp; $my->ex_sqlx("insert into parvaz_det_sites (parvaz_det_id,sites_id) values ({$id_inp},{$sites_id}) "); } } } $my->ex_sqlx("update parvaz_det set en=3 where id in (select parvaz_det_id from parvaz_det_sites where sites_id = {$sites_id}) " . (count($okDets) > 0 ? 'and not id in (' . implode(',', $okDets) . ')' : '')); }
function removeGran() { $my = new mysql_class(); $repeat = array(); $my->ex_sql("SELECT tarikh from parvaz_det group by tarikh order by tarikh ", $q); foreach ($q as $r) { $my->ex_sql("SELECT customer_id,flnum,id,zarfiat,ghimat from parvaz_det where tarikh='" . $r['tarikh'] . "' ORDER BY `parvaz_det`.`flnum` ASC", $p); //echo "SELECT customer_id,flnum,id,zarfiat,ghimat from parvaz_det where tarikh='".$r['tarikh']."' ORDER BY `parvaz_det`.`flnum` ASC <br/>"; $hs_tmp = ''; $hs_ghimat = 0; $hs_id = 0; $hs_zarfiat = 0; foreach ($p as $t) { if ($hs_tmp != $t['flnum']) { $hs_tmp = $t['flnum']; $hs_ghimat = $t['ghimat']; $hs_id = $t['id']; $hs_zarfiat = $t['zarfiat']; //echo $hs_tmp."<br/>"; } else { //echo "customer_id:".$t['customer_id'].' id:'.$t['id'].' flnum:'.$t['flnum']." ghimat:".$t['ghimat']." hs_ghimat:$hs_ghimat zarfiat:".$t['zarfiat']."<br/>"; if ($hs_ghimat < $t['ghimat']) { $repeat[] = $t['id']; } elseif ($hs_ghimat == $t['ghimat']) { if ($hs_zarfiat < $t['zarfiat']) { //echo "hs_id:".$hs_id.' id:'.$t['id']."<br/>"; $repeat[] = $hs_id; $hs_id = $t['id']; $hs_ghimat = $t['ghimat']; $hs_zarfiat = $t['zarfiat']; } else { $repeat[] = $t['id']; } } else { $repeat[] = $hs_id; $hs_id = $t['id']; $hs_ghimat = $t['ghimat']; $hs_zarfiat = $t['zarfiat']; } } } } if (count($repeat) > 0) { $my->ex_sqlx("update parvaz_det set en=0 where id in (" . implode(',', $repeat) . ")"); } }
public function add($args = array()) { $out = -1; if (is_array($args)) { $mysql = new mysql_class(); if (count($args) == 0 || !isset($args["toz"])) { $args["toz"] = $this->toz; $args["user_id"] = $this->user_id; $args["host"] = $this->host; $args["page_address"] = $this->page_address; $args["typ"] = $this->typ; } // echo "insert into `log` (`toz`,`user_id`,`host`,`page_address`) values ('".$args["toz"]."','".$args["user_id"]."','".$args["host"]."','".$args["page_address"]."')<br/>\n"; $mysql->ex_sqlx("insert into `log` (`toz`,`user_id`,`host`,`page_address`,`tarikh`,`typ`) values ('" . $args["toz"] . "','" . $args["user_id"] . "','" . $args["host"] . "','" . $args["page_address"] . "','" . date("Y-m-d H:i:s") . "','" . $args["typ"] . "')"); } return $out; }
public function loadByName($name = '') { if (trim($name) != '') { $name = trim($name); $mysql = new mysql_class(); $mysql->ex_sql("select * from havapeima where name='{$name}'", $q); if (isset($q[0])) { $r = $q[0]; $this->id = $q[0]['id']; $this->name = $q[0]["name"]; } else { $ln = $mysql->ex_sqlx("insert into havapeima (name) values ('{$name}') ", FALSE); $this->id = $mysql->insert_id($ln); $this->name = $name; $mysql->close($ln); } } }
function grid1_add($gname, $table, $fields, $col) { $conf = new conf(); function fieldToId($col, $fieldName) { $out = -1; foreach ($col as $id => $f) { if ($f['fieldname'] == $fieldName) { $out = $id; } } return $out; } //$rang = $fields['rang']; //$rtmp = explode('#',$rang); //if($rtmp[0]!='#') $fields["rang"] = "#" . $fields["rang"]; $fi = "("; $valu = "("; foreach ($fields as $field => $value) { $f_id = fieldToId($col, $field); $fn = isset($col[$f_id]['cfunction']) && isset($col[$f_id]['cfunction'][1]) ? $col[$f_id]['cfunction'][1] : ''; $fi .= "`{$field}`,"; $valu .= "'" . ($fn != '' ? $fn($value) : $value) . "',"; } $fi = substr($fi, 0, -1); $valu = substr($valu, 0, -1); $fi .= ")"; $valu .= ")"; $query = "insert into `{$table}` {$fi} values {$valu}"; $mysql = new mysql_class(); $ln = $mysql->ex_sqlx($query, FALSE); $out = $mysql->insert_id($ln); $mysql->close($ln); $ret = FALSE; if ($out > 0) { $ret = TRUE; } return $ret; }
function add_item($gname, $table, $fields, $col) { /* $conf = new conf; function fieldToId($col,$fieldName) { $out = -1; foreach($col as $id=>$f) if($f['fieldname']==$fieldName) $out = $id; return $out; } $fields['app']=$conf->app; $fields['content']="<span class='msg'>".$fields['content']."</span>"; $fi = "("; $valu="("; foreach ($fields as $field => $value) { $f_id = fieldToId($col,$field); $fn = (isset($col[$f_id]['cfunction']) && isset($col[$f_id]['cfunction'][1]))?$col[$f_id]['cfunction'][1]:''; $fi.="`$field`,"; $valu .="'".(($fn!='')?$fn($value):$value)."',"; } $fi=substr($fi,0,-1); $valu=substr($valu,0,-1); $fi.=")"; $valu.=")"; $query="insert into `$table` $fi values $valu"; $mysql = new mysql_class; $mysql->ex_sqlx($query); */ $conf = new conf(); $fields['app'] = $conf->app; $content = '<span class="tabligh">' . $fields['content'] . '</span>'; $mysql = new mysql_class(); $mysql->ex_sqlx("insert into `{$table}` (`content`, `app`) values ('{$content}','" . $fields['app'] . "')"); return TRUE; }
function add_item() { $fields = null; foreach ($_REQUEST as $key => $value) { if (substr($key, 0, 4) == "new_") { if ($key != "new_id") { $fields[substr($key, 4)] = $value; } } } $fi = "("; $valu = "("; foreach ($fields as $field => $value) { $fi .= "`{$field}`,"; $valu .= "'{$value}',"; } $fi = substr($fi, 0, -1); $valu = substr($valu, 0, -1); $fi .= ")"; $valu .= ")"; $query = "insert into `access` {$fi} values {$valu}"; mysql_class::ex_sqlx($query); echo $query; }
// echo '<h2>verification Error</h2><pre>خطا در پرداخت <br>لطقا با پشتیبانی تماس بگیرید</pre>'; $en = 6; } elseif ($res != $tprice) { echo 'verification failed : <br>بروز خطا در سیستم مالی<br>' . $res; // echo '<h2>verification Error 2</h2><pre>خطا در پرداخت <br>لطقا با پشتیبانی تماس بگیرید</pre>'; $en = 7; } else { $out = reserve_class::confirm($refrence_id); } } else { if ($en == 4) { echo 'رزرو شما توسط ادمین کنسل شد :' . "<br/>\n" . $State . '<br/>مبلغ شما تا ۷۲ ساعت دیگر به حساب شما بر می گردد<br/><a href="' . site_url() . '">بازگشت</a>'; } } } $my->ex_sqlx("update reserve set en = {$en} , bank_result = '" . json_encode($bank_result) . "', tarikh = '" . date("Y-m-d H:i:s") . "' where id = {$ResNum}"); } else { die('Access ERROR.'); } $voucher_id = $_SESSION['voucher_id']; $voucher = $voucher_id[0] . (count($voucher_id) == 2 ? '-' . $voucher_id[1] : ''); $refrence_id = $_SESSION['refrence_id']; $passengers = $_SESSION['passengers']; $data = $_SESSION['data']; $data2 = isset($_SESSION['data2']) ? $_SESSION['data2'] : ''; $adl = (int) $_SESSION['adl']; $chd = (int) $_SESSION['chd']; $inf = (int) $_SESSION['inf']; $price = $_SESSION['price']; $mobile = $_SESSION['mobile']; $address = $_SESSION['address'];
function del_item($table, $id, $gname) { $mysql = new mysql_class(); $re = $mysql->ex_sqlx("update `customer_parvaz` set `poorsant`='0' where `id`='{$id}'"); return $re == 'ok' ? TRUE : FALSE; }
$customer = new customer_class($info[0]->customer_id); $customer->buyTicket($sanad_record_id, $pardakht->mablagh, FALSE); $pardakht->update($sanad_record_id); //-------------- shenavar sanad------------ $sanad_record_id = sanad_class::getLastSanad_record_id(); $user_id = isset($_SESSION[conf::app . '_user_id']) ? (int) $_SESSION[conf::app . '_user_id'] : -1; foreach ($shenavar as $par) { parvaz_det_class::sanad_shenavar_kharid($par, $tedad, $sanad_record_id, $user_id); } //Sabte sanade pardakht parvaz.------------ $sanad_record_id = sanad_class::getLastSanad_record_id(); $tozihat = ' بابت خرید نقدی بلیت به شماره سند ' . $sanad_record_id_ticket; customer_class::pardakht($sanad_record_id, $info[0]->customer_id, $pardakht->mablagh, $tozihat, $user_id); } foreach ($res_tmp as $tmpid) { mysql_class::ex_sqlx("delete from `reserve_tmp` where `id` = " . $tmpid); } $rev = pay_class::settle($SaleOrderId, $SaleReferenceId); $rahgiri = pardakht_class::getBarcode($pardakht->id); $out = '<script langauge="javascript" >window.location = "finalticket2.php?ticket_type=0&sanad_record_id=' . $sanad_record_id_ticket . '&rahgiri=' . $rahgiri . '"</script>'; } else { $out = ' پرداخت انجام نشد مجدد سعی نمایید درصورت پرداخت وجه ، مبلغ از حساب شما کم نشده است <br/> <input class="inp" type="button" value="بازگشت" onclick="window.location=\'index.php\';" />'; } } else { $out = 'در تراکنش مالی مشکلی پیش آمده است پرداخت انجام نشد مجدد سعی نمایید درصورت پرداخت وجه ، مبلغ از حساب شما کم نشده است <br/> <input class="inp" type="button" value="بازگشت" onclick="window.location=\'index.php\';" />'; } ?>
public function fromDateToDate($start_date, $stop_date, $week_day = array()) { $mysql = new mysql_class(); $days = array(1 => "دوشنبه", 2 => "سهشنبه", 3 => "چهارشنبه", 4 => "پنجشنبه", 5 => "جمعه", 6 => "شنبه", 7 => "یکشنبه"); if (strtotime($stop_date) >= strtotime($start_date)) { $tmp = $start_date; while (strtotime($stop_date) >= strtotime($tmp)) { $ok = FALSE; $this_day = strtotime($tmp); $dayOfW = date("N", $this_day); for ($i = 0; $i < count($week_day); $i++) { if ($dayOfW == $week_day[$i]) { $ok = TRUE; } } if ($ok) { $mysql->ex_sql("select `id` from `parvaz_det` where `parvaz_id` = '" . $this->id . "' and `tarikh`='{$tmp}' and `saat`='" . $this->saat_def . "' and `en`='1' ", $q); if (!isset($q[0])) { $mysql->ex_sqlx("insert into `parvaz_det` (`parvaz_id`, `tarikh`, `saat`,`saat_kh`, `zarfiat`, `ghimat`, `typ`, `zakhire`, `poor_def`,`mablagh_kharid`,`customer_id`) values ('" . $this->id . "','{$tmp}','" . $this->saat_def . "','" . $this->saat_kh_def . "','" . $this->zarfiat_def . "','" . $this->ghimat_def . "','" . $this->typ_def . "','" . $this->zarfiat_def . "','" . $this->poor_def . "','" . $this->mablgh_kharid_def . "','" . $this->customer_id_det . "')"); if ($this->is_shenavar) { $mysql->ex_sql("SELECT `id` FROM `parvaz_det` WHERE `parvaz_id`='" . $this->id . "' and `tarikh`='{$tmp}' and `saat`='" . $this->saat_def . "' and `saat_kh`='" . $this->saat_kh_def . "' and `zarfiat`='" . $this->zarfiat_def . "' and `ghimat`='" . $this->ghimat_def . "' and `typ`='" . $this->typ_def . "' and `zakhire`='" . $this->zarfiat_def . "' and `poor_def`='" . $this->poor_def . "' and `mablagh_kharid`='" . $this->mablgh_kharid_def . "' and `customer_id`='" . $this->customer_id_det . "'", $qu); if (isset($qu)) { $r = $qu[0]; $parvaz_det = new parvaz_det_class($r['id']); $parvaz_det->kharidParvaz($this->zarfiat_def); } } } } $tmp = strtotime($tmp . " + 1 day"); $tmp = date("Y-m-d", $tmp); } } }