public function formMass($idList)
 {
     $todW = date('W', strtotime('today'));
     $claimList = array();
     $orderList = array();
     foreach ($idList as $order) {
         //номер текущей недели
         $nweek = date('W', strtotime($order['plan'])) - $todW;
         $dweek = date('w', strtotime($order['plan']));
         $orderOne = Order::getOrderById($order['oid']);
         if (isset($orderOne['contract'])) {
             if (Datas::isRekl($orderOne['contract'])) {
                 if ($order['otgruz_end'] == 2 || $orderOne['sum'] >= 1000) {
                     $claimList[$nweek . '-' . $dweek][$order['oid']] = $orderOne;
                     $claimList[$nweek . '-' . $dweek][$order['oid']]['plan'] = $order['plan'];
                     $claimList[$nweek . '-' . $dweek][$order['oid']]['tech_end'] = $order['tech_end'];
                     $claimList[$nweek . '-' . $dweek][$order['oid']]['upak_end'] = $order['upak_end'];
                     $claimList[$nweek . '-' . $dweek][$order['oid']]['otgruz_end'] = $order['otgruz_end'];
                 }
             } else {
                 $orderList[$nweek . '-' . $dweek][$order['oid']] = $orderOne;
                 $orderList[$nweek . '-' . $dweek][$order['oid']]['plan'] = $order['plan'];
                 $orderList[$nweek . '-' . $dweek][$order['oid']]['tech_end'] = $order['tech_end'];
                 $orderList[$nweek . '-' . $dweek][$order['oid']]['upak_end'] = $order['upak_end'];
                 $orderList[$nweek . '-' . $dweek][$order['oid']]['otgruz_end'] = $order['otgruz_end'];
             }
         }
     }
     $this->order = $orderList;
     $this->claim = $claimList;
 }
 public function run($form)
 {
     $nome = $form->get('nome');
     $cpf = $form->get('cpf');
     $cep = $form->get('cep');
     $pais = $form->get('pais');
     $estado = $form->get('estado');
     $cidade = $form->get('cidade');
     $bairro = $form->get('bairro');
     $logradouro = $form->get('logradouro');
     $numero = $form->get('numero');
     $complemento = $form->get('complemento');
     $telefone_residencial = $form->get('telefone_residencial');
     $telefone_celular = $form->get('telefone_celular');
     $telefone_comercial = $form->get('telefone_comercial');
     $email = $form->get('email');
     $sexo = $form->get('sexo');
     $data_nascimento = Datas::StringParaData($form->get('data_nascimento'));
     $escolaridade = $form->get('escolaridade');
     $segmento = $form->get('segmento');
     $pessoa = new Pessoa(null, $cpf, $nome, $cep, $pais, $estado, $cidade, $bairro, $logradouro, $numero, $complemento, $telefone_residencial, $telefone_celular, $telefone_comercial, $email, $sexo, $data_nascimento, $escolaridade, $segmento, Constants::$_ATIVO);
     $fachada = Fachada::getInstance();
     $fachada->cadastroPessoa()->cadastrar($pessoa);
     $this->setMessage("Pessoa cadastrado com sucesso.", Constants::$_MSG_SUCCESS);
     $this->load('100%');
     $this->setForward(Forward::go(CadastrarPessoaPage::$NM_PAGINA . '&msg_cadastro=sucesso'));
 }
 function actionClose($oid)
 {
     $today = date('Y-m-d', strtotime('today'));
     //получить данные о рекламациях
     $con = Order::getOrderById($oid);
     $noer = 1;
     if (!Datas::isRekl($con['contract'])) {
         $allrekl = Order::getOrdersLikeParam('contract', $con['contract']);
         foreach ($allrekl as $order) {
             $rekl = Datas::isRekl($order['contract']);
             $stan = OrderStan::getOrdersByPole('oid', $order['id']);
             if ($stan[$order['id']]['sborka_end'] == 0 && $rekl == 1) {
                 $noer = 0;
             }
         }
     }
     if ($noer == 1) {
         $res1 = OrderStan::updateStanByParam('sborka_end_date', $today, $oid);
         $res2 = OrderStan::updateStanByParam('sborka_end', '2', $oid);
         echo $res1 && $res2;
         //           echo $noer;
     } else {
         echo $noer;
     }
     return true;
 }
 /**
  * 函数GetClassCount,返回新闻分类数量
  * 返回分类数量(子分类数量可以通过where获得)
  * @return int
  */
 function GetClassCount($id)
 {
     $this->setTable('{tablepre}downloads_class');
     $where = '';
     if ($id != 0) {
         $where = ' parentid=' . $id;
     }
     return parent::GetListCount($where);
 }
 /**
  * 函数GetInfoCount,返回分类信息数量
  * 返回数量(子分类数量可以通过where获得)
  * @return int
  */
 function GetInfoCount($classid)
 {
     $this->setTable('{tablepre}products_photo');
     $where = '';
     if ($classid != 0) {
         $where = ' productid=' . $classid;
     }
     return parent::GetListCount($where);
 }
Exemple #6
0
 /**
  * 函数GetInfoCount,返回分类信息数量
  * 返回数量(子分类数量可以通过where获得)
  * @return int
  */
 function GetInfoCount($classid)
 {
     $this->setTable('{tablepre}links');
     $where = '';
     if ($classid != 0) {
         $where = ' classid=' . $classid;
     }
     return parent::GetListCount($where);
 }
 function actionSchedule()
 {
     $ri = $_COOKIE['ri'];
     $log = $_COOKIE['login'];
     if (!isset($ri)) {
         header('Location: /' . SITE_DIR . '/auth/showAuth');
     }
     $user = $_COOKIE['uid'];
     //   $user = 15;
     /*       if($ri!=6 && $ri!=7 && $ri!=1){
                 header('Location: /'.SITE_DIR.'/schedule');
             }*/
     //выбрать заказы несчитанные
     $order_current = OrderStan::getTechNotEnd($user);
     $order_overdue = array();
     foreach ($order_current as $key => $order) {
         if (strtotime($key) < strtotime('today')) {
             foreach ($order as $ord_one) {
                 $order_overdue[] = $ord_one;
             }
             unset($order_current[$key]);
         }
     }
     //     var_dump($order_current); die;
     //заказы закрытые за последний и текущий месяц
     $order_end = array();
     $claim_end = array();
     $order_list = OrderStan::getTechEnd($user);
     //перебор и сортировка
     $m = date('m');
     $month_of_year = array('01' => 'январь', '02' => 'февраль', '03' => 'март', '04' => 'апрель', '05' => 'май', '06' => 'июнь', '07' => 'июль', '08' => 'август', '09' => 'сентябрь', '10' => 'октябрь', '11' => 'ноябрь', '12' => 'декабрь');
     foreach ($month_of_year as $num => $name) {
         $sum_order[$name] = 0;
         $sum_claim[$name] = 0;
         $count_order[$name] = 0;
         $count_claim[$name] = 0;
     }
     foreach ($order_list as $order_one) {
         $pieces = explode('-', $order_one['tech_date']);
         $mbd = $pieces[1];
         if (Datas::isRekl($order_one['contract'])) {
             $claim_end[$month_of_year[$mbd]][] = $order_one;
             $sum_claim[$month_of_year[$mbd]] += $order_one['sum'];
             $count_claim[$month_of_year[$mbd]]++;
         } else {
             $order_end[$month_of_year[$mbd]][] = $order_one;
             $sum_order[$month_of_year[$mbd]] += $order_one['sum'];
             $count_order[$month_of_year[$mbd]]++;
         }
     }
     $page = SITE_PATH . 'views/technologist.php';
     include SITE_PATH . 'views/layout.php';
     return true;
 }
Exemple #8
0
 function actionTech()
 {
     $ri = $_COOKIE['ri'];
     $log = $_COOKIE['login'];
     if (!isset($ri)) {
         header('Location: /' . SITE_DIR . '/auth/showAuth');
     }
     //получить список технологов
     $userList6 = User_post::getUsersByPost(6);
     $userList7 = User_post::getUsersByPost(7);
     $userList = $userList6 + $userList7;
     $techList = array();
     foreach ($userList as $techid) {
         $datatech = Users::getUserById($techid['uid']);
         if ($datatech['validation'] == 1) {
             $techList[] = array('uid' => $datatech['id'], 'name' => Datas::nameAbr($datatech['name']));
         }
     }
     //        var_dump($techList);die;
     $no_reckoning = array();
     $orderList = Order::getOrdersNoReckoning();
     foreach ($orderList as $order) {
         $techdate = strtotime($order['tech_date']);
         if ($techdate < strtotime('today')) {
             $order['tech_date'] = date('Y-m-d', strtotime('yesterday'));
         }
         $no_reckoning[$order['technologist'] . '-' . $order['tech_date']][$order['oid']] = $order['contract'];
     }
     //var_dump($no_reckoning); die;
     $no_appoint = Order::getOrdersNoaAppointTech();
     //список дизайнеров
     $userList5 = User_post::getUsersByPost(5);
     $disList = array();
     foreach ($userList5 as $disid) {
         $datadis = Users::getUserById($disid['uid']);
         $disList[$datadis['id']] = Datas::nameAbr($datadis['name']);
     }
     //var_dump($disList);die;
     $page = SITE_PATH . 'views/plantech.php';
     include SITE_PATH . 'views/layout.php';
     return true;
 }
Exemple #9
0
 function actionIndex()
 {
     //обработка формы
     if (isset($_POST['login']) && isset($_POST['pass'])) {
         $log = $_POST['login'];
         $pass = $_POST['pass'];
         $res = Users::getUsersByParam('user_login', $log);
         if (empty($res) || $res[0]['user_password'] != md5(md5($pass))) {
             $this->error = 'Неверный логин-пароль';
             $this->actionShowAuth();
         } else {
             $hash = Datas::generateCode(20);
             Users::updateUsersByParam('user_hash', $hash, $res[0]['id']);
             setcookie("hash", $hash);
             setcookie("uid", $res[0]['id']);
             header('Location: /' . SITE_DIR . '/');
         }
     }
     return true;
 }
 public function getAndCheckArgs($argv)
 {
     if (!$argv) {
         return false;
     }
     $args_ok = array();
     foreach ($argv as $arg) {
         if (!preg_match('/^--([^=\'"><|`]+)(?:=([^=><|`]+)|(?!license))/i', trim($arg), $res)) {
             continue;
         }
         if ($res[1] == 'license' && !isset($res[2])) {
             $res[2] = 1;
         } elseif (!isset($res[2])) {
             continue;
         }
         $args_ok[$res[1]] = $res[2];
     }
     $errors = array();
     foreach (Datas::getArgs() as $key => $row) {
         if (isset($row['name'])) {
             $name = $row['name'];
         } else {
             $name = $key;
         }
         if (!isset($args_ok[$name])) {
             if (!isset($row['default'])) {
                 $errors[] = 'Field ' . $row['name'] . ' is empty';
             } else {
                 $this->{$key} = $row['default'];
             }
         } elseif (isset($row['validate']) && !call_user_func(array('Validate', $row['validate']), $args_ok[$name])) {
             $errors[] = 'Field ' . $key . ' is not valid';
         } else {
             $this->{$key} = $args_ok[$name];
         }
     }
     return count($errors) ? $errors : true;
 }
Exemple #11
0
<?php

require_once "conf.php";
require_once "conexao.class.php";
require_once "Turma.class.php";
require_once "Datas.class.php";
$Data = new Datas();
/*
   $novaConexao = new Conexao($conexaoBD['bd'],$conexaoBD['usuario'],$conexaoBD['senha'],$conexaoBD['host']);
   $novaConexao->getConexao();


	$turma = new Turma(1);
	$turma->montaGrade();

  // $teste = mysql_query("SELECT * FROM horario") or die(mysql_error());
 // $dados = mysql_fetch_assoc($teste);

  // var_dump($dados);
*/
$dataInicial = explode("-", $inicioPeriodo);
$dia = $dataInicial[0];
$mes = $dataInicial[1];
/**
 * Abreviação de 3 letras do dia da semana
 */
//  $diaSemana =  diaSemana($mes,$dia,$anoLetivo);
/**
 * Total de dias do mês
 */
$diaSemana = $Data->diaSemana($dia, $mes, $ano);
Exemple #12
0
 /**
  * Datas的构造函数 无需传参数
  */
 function __construct()
 {
     parent::__construct('{tablepre}users_log');
 }
Exemple #13
0
 function actionCollHoliday()
 {
     if (!empty($_POST['date'])) {
         $datedb = Datas::dateToDb($_POST['date']);
         $uid = $_POST['uid'];
         //проверка наличия записи
         $list = Freemen::getFreeday($uid);
         if (!in_array($datedb, $list)) {
             Freemen::addFree($uid, $datedb);
             $user = Users::getUserById($uid);
             $name = Datas::nameAbr($user['name']);
             echo $name . 'f' . $datedb . 'f' . $uid;
         }
     }
     return true;
 }
Exemple #14
0
 /**
  * 函数GetInfoCount,返回分类信息数量
  * 返回数量可以通过where获得)
  * @return int
  */
 function GetInfoCount()
 {
     $this->setTable('{tablepre}menus');
     $where = '';
     return parent::GetListCount($where);
 }
 public final function __construct($step)
 {
     $this->step = $step;
     $this->datas = Datas::getInstance();
     // Set current language
     $this->language = InstallLanguages::getInstance();
     if (!$this->datas->language) {
         die('No language defined');
     }
     $this->language->setLanguage($this->datas->language);
     $this->init();
 }
Exemple #16
0
 function actionAssembly()
 {
     $ri = $_COOKIE['ri'];
     $log = $_COOKIE['login'];
     if (!isset($ri)) {
         header('Location: /' . SITE_DIR . '/auth/showAuth');
     }
     $begin = '';
     $end = '';
     if (isset($_POST['submit'])) {
         if (isset($_POST['begin']) && isset($_POST['end'])) {
             $begin = Datas::dateToDb($_POST['begin']);
             $end = Datas::dateToDb($_POST['end']);
             $odderList = array();
             //закрытые заказы
             $beznal = array();
             $coll = array();
             $rekl = array();
             $dillerskie = array();
             $dontclose = array();
             //список диллерских инициалов
             $dil = Dillers::getAllDillers();
             $list = OrderStan::getOrdersByPeriod($begin, $end, 'sborka_end_date');
             foreach ($list as $one) {
                 $order = Order::getOrderById($one['oid']);
                 if ($order) {
                     $order['sborka_end_date'] = $one['sborka_end_date'];
                     //выделить безнал и рекламации
                     if ($order['beznal'] == 1 || $order['rassr'] == 1) {
                         $beznal[$order['collector']][] = $order;
                     } elseif (Datas::isRekl($order['contract'])) {
                         $rekl[$order['collector']][] = $order;
                     } else {
                         $d = false;
                         foreach ($dil as $onedil) {
                             //найти подстроку в номере договора
                             $pos = strpos($order['contract'], $onedil['flag']);
                             if ($pos !== false && $pos == 0) {
                                 $d = true;
                             }
                         }
                         if ($d) {
                             $dillerskie[$order['collector']][] = $order;
                         } else {
                             $odderList[$order['collector']][] = $order;
                         }
                     }
                 }
             }
         }
     }
     //список всех сборщиков
     $coll = array();
     $idusers = User_post::getUsersByPost(17);
     foreach ($idusers as $id) {
         $user = Users::getUsersByParam('id', $id['uid']);
         $coll[$user[0]['id']] = $user[0]['name'];
         //незакрытые заказы
         $dontclose[$id['uid']] = OrderStan::getNeSobr($id['uid']);
     }
     $page = SITE_PATH . 'views/repsb.php';
     include SITE_PATH . 'views/layout.php';
     return true;
 }
Exemple #17
0
 /**
  * Datas的构造函数 无需传参数
  */
 function __construct()
 {
     parent::__construct('{tablepre}adflash');
 }
Exemple #18
0
 /**
  * Datas的构造函数 无需传参数
  */
 function __construct()
 {
     parent::__construct('`{tablepre}keys`');
 }
Exemple #19
0
 public static function add($contract, $contract_date, $name, $product, $adress, $phone, $term, $designer, $sum, $prepayment, $rassr, $beznal)
 {
     $db = Db::getConection();
     //Именованные метки
     $stmt = $db->prepare("INSERT INTO orders (contract, contract_date, name, product, adress, phone, date, term, designer, sum, prepayment, rassr, beznal)\nVALUES (:contract, :contract_date, :name, :product, :adress, :phone, CURDATE(), :term, :designer, :sum, :prepayment, :rassr, :beznal)");
     $stmt->execute(array('contract' => $contract, 'contract_date' => Datas::dateToDb($contract_date), 'name' => $name, 'product' => $product, 'adress' => $adress, 'phone' => $phone, 'term' => $term, 'designer' => $designer, 'sum' => $sum, 'prepayment' => $prepayment, 'rassr' => $rassr, 'beznal' => $beznal));
     $oid = $db->lastInsertId();
     return $oid;
 }
Exemple #20
0
 * @param string, nome do banco
 * @param string, usuario 
 * @param string, senha
 * @param string, host
 */
$novaConexao = new Conexao($conexaoBD['bd'], $conexaoBD['usuario'], $conexaoBD['senha'], $conexaoBD['host']);
$novaConexao->getConexao();
/**
 * Array para somar a qtde total 
 * de aulas por disciplinas
 */
$qtdeAulas = array();
/**
 * Recebe a instancia da classe Data 
 */
$Data = new Datas();
/**
 * Recebe a instancia da classe Turma
 * @param int, código do curso
 */
$turma = new Turma($curso, $periodoCurso, $turnoCurso);
$gradeTurma = $turma->montaGrade();
if ($gradeTurma != false) {
    /**
     * Separador da data
     */
    $dataInicial = explode("-", $inicioPeriodo);
    /**
     * Atribui a data de inicio do período
     * as váriaveis dia e mes
     */
 /**
  * Datas的构造函数 无需传参数
  */
 function __construct()
 {
     parent::__construct('{tablepre}users_classpower');
 }
Exemple #22
0
 public final function __construct($step)
 {
     $this->step = $step;
     $this->datas = Datas::getInstance();
     // Set current language
     $this->language = LanguageList::getInstance();
     Context::getContext()->language = $this->language->getLanguage($this->datas->language);
     $this->translator = Context::getContext()->getTranslator();
     if (!$this->datas->language) {
         die('No language defined');
     }
     $this->language->setLanguage($this->datas->language);
     $this->init();
 }
Exemple #23
0
 echo date('d.m', $day_date);
 ?>
                             </td>
                         </tr>
                         <?php 
 if (isset($orderList[$W . '-' . $w])) {
     foreach ($orderList[$W . '-' . $w] as $oid => $day) {
         ?>
                                 <?php 
         // определение цвета ячейки
         $cbgcol = 'c0e6c0';
         $ctcol = '000000';
         $contract = $day['contract'];
         // определить рекламацию
         $lit1 = Datas::substr_function($contract, -1, 1);
         $lit2 = Datas::substr_function($contract, -2, -1);
         if ($day['otgruz_end'] == 2) {
             $cbgcol = 'ffff00';
             if ($lit1 == 'Р' || $lit2 == 'Р') {
                 $cbgcol = 'FFD700';
             }
         } elseif ($day['upak_end'] == 2) {
             $cbgcol = '00b050';
         } elseif ($day['tech_end'] == 2) {
             $cbgcol = '00b0f0';
         }
         if (strtotime("today") > strtotime($day['term']) && $day['otgruz_end'] !== '2' && $day['term'] != '0000-00-00') {
             $ctcol = '7030a0; font-weight:800';
         }
         if ($lit1 == 'Р' || $lit2 == 'Р') {
             $ctcol = 'a60303; font-weight:800';
Exemple #24
0
 /**
  * Datas的构造函数 无需传参数
  */
 function __construct()
 {
     parent::__construct('{tablepre}links_class');
 }
Exemple #25
0
 function actionIndex()
 {
     $ri = $_COOKIE['ri'];
     $log = $_COOKIE['login'];
     if (!isset($ri)) {
         header('Location: /' . SITE_DIR . '/auth/showAuth');
     }
     $contract = '';
     $con_date = '';
     $name = '';
     $prod = '';
     $termin = '';
     $otkr = 0;
     $sum = '';
     $rassr = 0;
     $beznal = 0;
     $pred = '';
     $dis = '';
     $adress = '';
     $phone = '';
     $note = '';
     //получить список дизайнеров
     $userList = User_post::getUsersByPost(5);
     $disList = array();
     foreach ($userList as $disid) {
         $datadis = Users::getUserById($disid['uid']);
         if ($datadis['validation'] == 1) {
             $disList[] = array('uid' => $datadis['id'], 'name' => $datadis['name']);
         }
     }
     //    var_dump($disList);
     if (isset($_POST['submit'])) {
         //текстовые поля
         if (isset($_POST['num'])) {
             $contract = $_POST['num'];
         }
         if (isset($_POST['con_date'])) {
             $con_date = $_POST['con_date'];
         }
         if (isset($_POST['name'])) {
             $name = $_POST['name'];
         }
         if (isset($_POST['prod'])) {
             $prod = $_POST['prod'];
         }
         if (isset($_POST['term'])) {
             $termin = $_POST['term'];
             $term = Datas::checkSunday($termin);
         }
         if (isset($_POST['sum'])) {
             $sum = str_replace(",", ".", $_POST['sum']);
         }
         if (isset($_POST['pred'])) {
             $pred = str_replace(",", ".", $_POST['pred']);
         }
         if (isset($_POST['adress'])) {
             $adress = $_POST['adress'];
         }
         if (isset($_POST['phone'])) {
             $phone = $_POST['phone'];
         }
         if (isset($_POST['note'])) {
             $note = $_POST['note'];
         }
         //чекбоксы
         if (isset($_POST['beznal'])) {
             $beznal = 1;
         }
         if (isset($_POST['otkr'])) {
             $otkr = 1;
         }
         if (isset($_POST['rassr'])) {
             $rassr = 1;
         }
         //селект
         if (isset($_POST['dis'])) {
             $dis = $_POST['dis'];
         }
         $errors = false;
         if (!Datas::checkPole($contract)) {
             $errors[] = 'Не введен номер заказа';
         }
         if (!Datas::checkPole($name)) {
             $errors[] = 'Как обращаться к заказчику?';
         }
         if (!Datas::checkPole($termin) && $otkr == 0) {
             $errors[] = 'Не указан срок договора';
         }
         if (!Datas::checkPole($sum)) {
             $errors[] = 'Укажите сумму договора';
         }
         if (!Datas::checkPole($phone)) {
             $errors[] = 'Введите номер телефона';
         }
         $dubl = Order::getOrdersByParam('contract', $contract);
         if (!empty($dubl)) {
             $errors[] = 'Уже есть заказ с таким номером';
         }
         $result = NULL;
         if (!$errors) {
             //вносим в базу
             $result = Order::add($contract, $con_date, $name, $prod, $adress, $phone, $term, $dis, $sum, $pred, $rassr, $beznal);
             if (!empty($result)) {
                 OrderStan::add($result, $term);
                 if ($note != '') {
                     Notes::setNote($result, $note);
                 }
             }
         }
     }
     $page = SITE_PATH . 'views/new.php';
     include SITE_PATH . 'views/layout.php';
     return true;
 }